Where can I find an exhaustive explanation to the meaning
of wdFieldType values? As it usually happens with VBA
help, a complete list of values is presented
(wdFieldAddIn, wdFieldAdvance...), but there's no way to
know how those constants work.
I've searched in WordBasic help too, trying to find some
kind of analogy, but that didn't help me at all.

Thanks.


--
______________________
Life is a dream, make it real.

RE: wdFieldType values by JayFreedman

JayFreedman
Sun Feb 20 13:47:03 CST 2005

Hi Ron,

When you peel off the wdField prefix, what's left corresponds to the keyword
that starts the field code of the field you'll get when you use Fields.Add.

Ask the regular Word help file for "Field code <type>" for that <type> --
for example, ask about "Field code AddIn" or "Field code Advance". You'll get
a list of the other information that can be included in that field code, such
as a bookmark name, a file name, or various switches.

--
Regards,
Jay Freedman

"Ron John" wrote:

> Where can I find an exhaustive explanation to the meaning
> of wdFieldType values? As it usually happens with VBA
> help, a complete list of values is presented
> (wdFieldAddIn, wdFieldAdvance...), but there's no way to
> know how those constants work.
> I've searched in WordBasic help too, trying to find some
> kind of analogy, but that didn't help me at all.
>
> Thanks.
>
>
> --
> ______________________
> Life is a dream, make it real.
>
>
>

Re: wdFieldType values by Jezebel

Jezebel
Sun Feb 20 14:49:09 CST 2005

As a general answer, of course, it's quite right. But AddIn fields are not
documented in Help.



"Jay Freedman" <JayFreedman@discussions.microsoft.com> wrote in message
news:0B9E06B1-CD2F-416F-9A60-A5AC50067B40@microsoft.com...
> Hi Ron,
>
> When you peel off the wdField prefix, what's left corresponds to the
> keyword
> that starts the field code of the field you'll get when you use
> Fields.Add.
>
> Ask the regular Word help file for "Field code <type>" for that <type> --
> for example, ask about "Field code AddIn" or "Field code Advance". You'll
> get
> a list of the other information that can be included in that field code,
> such
> as a bookmark name, a file name, or various switches.
>
> --
> Regards,
> Jay Freedman
>
> "Ron John" wrote:
>
>> Where can I find an exhaustive explanation to the meaning
>> of wdFieldType values? As it usually happens with VBA
>> help, a complete list of values is presented
>> (wdFieldAddIn, wdFieldAdvance...), but there's no way to
>> know how those constants work.
>> I've searched in WordBasic help too, trying to find some
>> kind of analogy, but that didn't help me at all.
>>
>> Thanks.
>>
>>
>> --
>> ______________________
>> Life is a dream, make it real.
>>
>>
>>



Re: wdFieldType values by Jay

Jay
Mon Feb 21 20:59:32 CST 2005

They're documented at
http://word.mvps.org/FAQs/TblsFldsFms/AddinFields.htm instead. :-)

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org

On Mon, 21 Feb 2005 07:49:09 +1100, "Jezebel"
<warcrimes@whitehouse.gov> wrote:

>As a general answer, of course, it's quite right. But AddIn fields are not
>documented in Help.
>
>
>
>"Jay Freedman" <JayFreedman@discussions.microsoft.com> wrote in message
>news:0B9E06B1-CD2F-416F-9A60-A5AC50067B40@microsoft.com...
>> Hi Ron,
>>
>> When you peel off the wdField prefix, what's left corresponds to the
>> keyword
>> that starts the field code of the field you'll get when you use
>> Fields.Add.
>>
>> Ask the regular Word help file for "Field code <type>" for that <type> --
>> for example, ask about "Field code AddIn" or "Field code Advance". You'll
>> get
>> a list of the other information that can be included in that field code,
>> such
>> as a bookmark name, a file name, or various switches.
>>
>> --
>> Regards,
>> Jay Freedman
>>
>> "Ron John" wrote:
>>
>>> Where can I find an exhaustive explanation to the meaning
>>> of wdFieldType values? As it usually happens with VBA
>>> help, a complete list of values is presented
>>> (wdFieldAddIn, wdFieldAdvance...), but there's no way to
>>> know how those constants work.
>>> I've searched in WordBasic help too, trying to find some
>>> kind of analogy, but that didn't help me at all.
>>>
>>> Thanks.
>>>
>>>
>>> --
>>> ______________________
>>> Life is a dream, make it real.
>>>
>>>
>>>
>


Re: wdFieldType values by Ron

Ron
Tue Feb 22 13:43:42 CST 2005

Thanks for the info, I have sorted out that bit already.
Now I have another question: how can I remove all the auto fields in the
document.
The code below doesn't work in all occasions. In some instances, after
running that code, the document still contains some auto fields. Most of the
time they are at the end of the document, usually in headers and footers.
Any ideas why that happens?

Set objWord = New Word.Application
Set objDoc = objWord.Documents.Open("C:\1.doc", False, True, , "")
With objDoc
For i = 1 To .Fields.Count
.Fields(i).Delete
Next i
.SaveAs "C:\1.txt", wdFormatText
.Close wdDoNotSaveChanges
End With

--
______________________
Life is a dream, make it real.
"Jay Freedman" <jay.freedman@verizon.net> wrote in message
news:3v7l11le6gnm34c9hm1h7umjioedqhhq2b@4ax.com...
> They're documented at
> http://word.mvps.org/FAQs/TblsFldsFms/AddinFields.htm instead. :-)
>
> --
> Regards,
> Jay Freedman
> Microsoft Word MVP FAQ: http://word.mvps.org
>
> On Mon, 21 Feb 2005 07:49:09 +1100, "Jezebel"
> <warcrimes@whitehouse.gov> wrote:
>
>>As a general answer, of course, it's quite right. But AddIn fields are not
>>documented in Help.
>>
>>
>>
>>"Jay Freedman" <JayFreedman@discussions.microsoft.com> wrote in message
>>news:0B9E06B1-CD2F-416F-9A60-A5AC50067B40@microsoft.com...
>>> Hi Ron,
>>>
>>> When you peel off the wdField prefix, what's left corresponds to the
>>> keyword
>>> that starts the field code of the field you'll get when you use
>>> Fields.Add.
>>>
>>> Ask the regular Word help file for "Field code <type>" for that
>>> <type> --
>>> for example, ask about "Field code AddIn" or "Field code Advance".
>>> You'll
>>> get
>>> a list of the other information that can be included in that field code,
>>> such
>>> as a bookmark name, a file name, or various switches.
>>>
>>> --
>>> Regards,
>>> Jay Freedman
>>>
>>> "Ron John" wrote:
>>>
>>>> Where can I find an exhaustive explanation to the meaning
>>>> of wdFieldType values? As it usually happens with VBA
>>>> help, a complete list of values is presented
>>>> (wdFieldAddIn, wdFieldAdvance...), but there's no way to
>>>> know how those constants work.
>>>> I've searched in WordBasic help too, trying to find some
>>>> kind of analogy, but that didn't help me at all.
>>>>
>>>> Thanks.
>>>>
>>>>
>>>> --
>>>> ______________________
>>>> Life is a dream, make it real.
>>>>
>>>>
>>>>
>>
>



Re: wdFieldType values by Jezebel

Jezebel
Tue Feb 22 14:25:34 CST 2005

The document.Fields() collection includes only the fields in the body of the
document. To get all fields, wherever they occur, you need to iterate all
the SotryRanges separately --

Dim pRange as Word.Range
For each pRange in objDoc.StoryRanges
Do
Do until pRange.Fields.Count = 0
pRange.Fields(1).Delete
Loop
set pRange = pRange.Next
Loop until pRange is nothing
Next





"Ron John" <anglas@gmailNOSPAM.com> wrote in message
news:cvg21n$979$1@news.freedom2surf.net...
> Thanks for the info, I have sorted out that bit already.
> Now I have another question: how can I remove all the auto fields in the
> document.
> The code below doesn't work in all occasions. In some instances, after
> running that code, the document still contains some auto fields. Most of
> the time they are at the end of the document, usually in headers and
> footers. Any ideas why that happens?
>
> Set objWord = New Word.Application
> Set objDoc = objWord.Documents.Open("C:\1.doc", False, True, , "")
> With objDoc
> For i = 1 To .Fields.Count
> .Fields(i).Delete
> Next i
> .SaveAs "C:\1.txt", wdFormatText
> .Close wdDoNotSaveChanges
> End With
>
> --
> ______________________
> Life is a dream, make it real.
> "Jay Freedman" <jay.freedman@verizon.net> wrote in message
> news:3v7l11le6gnm34c9hm1h7umjioedqhhq2b@4ax.com...
>> They're documented at
>> http://word.mvps.org/FAQs/TblsFldsFms/AddinFields.htm instead. :-)
>>
>> --
>> Regards,
>> Jay Freedman
>> Microsoft Word MVP FAQ: http://word.mvps.org
>>
>> On Mon, 21 Feb 2005 07:49:09 +1100, "Jezebel"
>> <warcrimes@whitehouse.gov> wrote:
>>
>>>As a general answer, of course, it's quite right. But AddIn fields are
>>>not
>>>documented in Help.
>>>
>>>
>>>
>>>"Jay Freedman" <JayFreedman@discussions.microsoft.com> wrote in message
>>>news:0B9E06B1-CD2F-416F-9A60-A5AC50067B40@microsoft.com...
>>>> Hi Ron,
>>>>
>>>> When you peel off the wdField prefix, what's left corresponds to the
>>>> keyword
>>>> that starts the field code of the field you'll get when you use
>>>> Fields.Add.
>>>>
>>>> Ask the regular Word help file for "Field code <type>" for that
>>>> <type> --
>>>> for example, ask about "Field code AddIn" or "Field code Advance".
>>>> You'll
>>>> get
>>>> a list of the other information that can be included in that field
>>>> code,
>>>> such
>>>> as a bookmark name, a file name, or various switches.
>>>>
>>>> --
>>>> Regards,
>>>> Jay Freedman
>>>>
>>>> "Ron John" wrote:
>>>>
>>>>> Where can I find an exhaustive explanation to the meaning
>>>>> of wdFieldType values? As it usually happens with VBA
>>>>> help, a complete list of values is presented
>>>>> (wdFieldAddIn, wdFieldAdvance...), but there's no way to
>>>>> know how those constants work.
>>>>> I've searched in WordBasic help too, trying to find some
>>>>> kind of analogy, but that didn't help me at all.
>>>>>
>>>>> Thanks.
>>>>>
>>>>>
>>>>> --
>>>>> ______________________
>>>>> Life is a dream, make it real.
>>>>>
>>>>>
>>>>>
>>>
>>
>
>



Re: wdFieldType values by Ron

Ron
Tue Feb 22 16:06:49 CST 2005


Excellent! That's exactly what I was looking for.
My mistake was to assume that document.fields() returns all the fields in
the document...
Thanks a lot for your help.

--
______________________
Life is a dream, make it real.
"Jezebel" <warcrimes@whitehouse.gov> wrote in message
news:O1q1oyRGFHA.524@TK2MSFTNGP14.phx.gbl...
> The document.Fields() collection includes only the fields in the body of
> the document. To get all fields, wherever they occur, you need to iterate
> all the SotryRanges separately --
>
> Dim pRange as Word.Range
> For each pRange in objDoc.StoryRanges
> Do
> Do until pRange.Fields.Count = 0
> pRange.Fields(1).Delete
> Loop
> set pRange = pRange.Next
> Loop until pRange is nothing
> Next
>
>
>
>
>
> "Ron John" <anglas@gmailNOSPAM.com> wrote in message
> news:cvg21n$979$1@news.freedom2surf.net...
>> Thanks for the info, I have sorted out that bit already.
>> Now I have another question: how can I remove all the auto fields in the
>> document.
>> The code below doesn't work in all occasions. In some instances, after
>> running that code, the document still contains some auto fields. Most of
>> the time they are at the end of the document, usually in headers and
>> footers. Any ideas why that happens?
>>
>> Set objWord = New Word.Application
>> Set objDoc = objWord.Documents.Open("C:\1.doc", False, True, , "")
>> With objDoc
>> For i = 1 To .Fields.Count
>> .Fields(i).Delete
>> Next i
>> .SaveAs "C:\1.txt", wdFormatText
>> .Close wdDoNotSaveChanges
>> End With
>>
>> --
>> ______________________
>> Life is a dream, make it real.
>> "Jay Freedman" <jay.freedman@verizon.net> wrote in message
>> news:3v7l11le6gnm34c9hm1h7umjioedqhhq2b@4ax.com...
>>> They're documented at
>>> http://word.mvps.org/FAQs/TblsFldsFms/AddinFields.htm instead. :-)
>>>
>>> --
>>> Regards,
>>> Jay Freedman
>>> Microsoft Word MVP FAQ: http://word.mvps.org
>>>
>>> On Mon, 21 Feb 2005 07:49:09 +1100, "Jezebel"
>>> <warcrimes@whitehouse.gov> wrote:
>>>
>>>>As a general answer, of course, it's quite right. But AddIn fields are
>>>>not
>>>>documented in Help.
>>>>
>>>>
>>>>
>>>>"Jay Freedman" <JayFreedman@discussions.microsoft.com> wrote in message
>>>>news:0B9E06B1-CD2F-416F-9A60-A5AC50067B40@microsoft.com...
>>>>> Hi Ron,
>>>>>
>>>>> When you peel off the wdField prefix, what's left corresponds to the
>>>>> keyword
>>>>> that starts the field code of the field you'll get when you use
>>>>> Fields.Add.
>>>>>
>>>>> Ask the regular Word help file for "Field code <type>" for that
>>>>> <type> --
>>>>> for example, ask about "Field code AddIn" or "Field code Advance".
>>>>> You'll
>>>>> get
>>>>> a list of the other information that can be included in that field
>>>>> code,
>>>>> such
>>>>> as a bookmark name, a file name, or various switches.
>>>>>
>>>>> --
>>>>> Regards,
>>>>> Jay Freedman
>>>>>
>>>>> "Ron John" wrote:
>>>>>
>>>>>> Where can I find an exhaustive explanation to the meaning
>>>>>> of wdFieldType values? As it usually happens with VBA
>>>>>> help, a complete list of values is presented
>>>>>> (wdFieldAddIn, wdFieldAdvance...), but there's no way to
>>>>>> know how those constants work.
>>>>>> I've searched in WordBasic help too, trying to find some
>>>>>> kind of analogy, but that didn't help me at all.
>>>>>>
>>>>>> Thanks.
>>>>>>
>>>>>>
>>>>>> --
>>>>>> ______________________
>>>>>> Life is a dream, make it real.
>>>>>>
>>>>>>
>>>>>>
>>>>
>>>
>>
>>
>
>



Re: wdFieldType values by Ron

Ron
Thu Feb 24 14:26:54 CST 2005

Hi Jezebel,
I've got a document that i am having troubles deleting all auto fields. You
can see this document at http://www.loutom.f2s.com/1.doc
At some point fields.count stays the same no mater how many times you call
fields(1).delete.
Can you please shed some light on why certain fields can not be deleted ?
--
______________________
Life is a dream, make it real.
"Jezebel" <warcrimes@whitehouse.gov> wrote in message
news:O1q1oyRGFHA.524@TK2MSFTNGP14.phx.gbl...
> The document.Fields() collection includes only the fields in the body of
> the document. To get all fields, wherever they occur, you need to iterate
> all the SotryRanges separately --
>
> Dim pRange as Word.Range
> For each pRange in objDoc.StoryRanges
> Do
> Do until pRange.Fields.Count = 0
> pRange.Fields(1).Delete
> Loop
> set pRange = pRange.Next
> Loop until pRange is nothing
> Next
>
>
>
>
>
> "Ron John" <anglas@gmailNOSPAM.com> wrote in message
> news:cvg21n$979$1@news.freedom2surf.net...
>> Thanks for the info, I have sorted out that bit already.
>> Now I have another question: how can I remove all the auto fields in the
>> document.
>> The code below doesn't work in all occasions. In some instances, after
>> running that code, the document still contains some auto fields. Most of
>> the time they are at the end of the document, usually in headers and
>> footers. Any ideas why that happens?
>>
>> Set objWord = New Word.Application
>> Set objDoc = objWord.Documents.Open("C:\1.doc", False, True, , "")
>> With objDoc
>> For i = 1 To .Fields.Count
>> .Fields(i).Delete
>> Next i
>> .SaveAs "C:\1.txt", wdFormatText
>> .Close wdDoNotSaveChanges
>> End With
>>
>> --
>> ______________________
>> Life is a dream, make it real.
>> "Jay Freedman" <jay.freedman@verizon.net> wrote in message
>> news:3v7l11le6gnm34c9hm1h7umjioedqhhq2b@4ax.com...
>>> They're documented at
>>> http://word.mvps.org/FAQs/TblsFldsFms/AddinFields.htm instead. :-)
>>>
>>> --
>>> Regards,
>>> Jay Freedman
>>> Microsoft Word MVP FAQ: http://word.mvps.org
>>>
>>> On Mon, 21 Feb 2005 07:49:09 +1100, "Jezebel"
>>> <warcrimes@whitehouse.gov> wrote:
>>>
>>>>As a general answer, of course, it's quite right. But AddIn fields are
>>>>not
>>>>documented in Help.
>>>>
>>>>
>>>>
>>>>"Jay Freedman" <JayFreedman@discussions.microsoft.com> wrote in message
>>>>news:0B9E06B1-CD2F-416F-9A60-A5AC50067B40@microsoft.com...
>>>>> Hi Ron,
>>>>>
>>>>> When you peel off the wdField prefix, what's left corresponds to the
>>>>> keyword
>>>>> that starts the field code of the field you'll get when you use
>>>>> Fields.Add.
>>>>>
>>>>> Ask the regular Word help file for "Field code <type>" for that
>>>>> <type> --
>>>>> for example, ask about "Field code AddIn" or "Field code Advance".
>>>>> You'll
>>>>> get
>>>>> a list of the other information that can be included in that field
>>>>> code,
>>>>> such
>>>>> as a bookmark name, a file name, or various switches.
>>>>>
>>>>> --
>>>>> Regards,
>>>>> Jay Freedman
>>>>>
>>>>> "Ron John" wrote:
>>>>>
>>>>>> Where can I find an exhaustive explanation to the meaning
>>>>>> of wdFieldType values? As it usually happens with VBA
>>>>>> help, a complete list of values is presented
>>>>>> (wdFieldAddIn, wdFieldAdvance...), but there's no way to
>>>>>> know how those constants work.
>>>>>> I've searched in WordBasic help too, trying to find some
>>>>>> kind of analogy, but that didn't help me at all.
>>>>>>
>>>>>> Thanks.
>>>>>>
>>>>>>
>>>>>> --
>>>>>> ______________________
>>>>>> Life is a dream, make it real.
>>>>>>
>>>>>>
>>>>>>
>>>>
>>>
>>
>>
>
>



Re: wdFieldType values by Bob

Bob
Fri Mar 04 12:29:54 CST 2005

On Thu, 24 Feb 2005 20:26:54 -0000, "Ron John"
<anglas@gmailNOSPAM.com> wrote:

>Hi Jezebel,
>I've got a document that i am having troubles deleting all auto fields. You
>can see this document at http://www.loutom.f2s.com/1.doc
>At some point fields.count stays the same no mater how many times you call
>fields(1).delete.
>Can you please shed some light on why certain fields can not be deleted ?

Does the document have multiple sections with headers or footers that
have "same as previous" turned off and one of the headers or footers
is empty?

Bob S

Re: wdFieldType values by Ron

Ron
Fri Mar 04 14:27:23 CST 2005

no, the document had tracking changes option turned on...

--
______________________
Life is a dream, make it real.
"Bob S" <notarealaddress@110.net> wrote in message
news:e6ah21dlvkv3do867s9cvr52536d920vdf@4ax.com...
> On Thu, 24 Feb 2005 20:26:54 -0000, "Ron John"
> <anglas@gmailNOSPAM.com> wrote:
>
>>Hi Jezebel,
>>I've got a document that i am having troubles deleting all auto fields.
>>You
>>can see this document at http://www.loutom.f2s.com/1.doc
>>At some point fields.count stays the same no mater how many times you call
>>fields(1).delete.
>>Can you please shed some light on why certain fields can not be deleted ?
>
> Does the document have multiple sections with headers or footers that
> have "same as previous" turned off and one of the headers or footers
> is empty?
>
> Bob S