Position of Field / DocVaiable in Word

J

Jon.NET

Hi there,

Is there any way to programmatically get the Position of a Field in Word? -
as Bookmarks.

Thanks

Jon
 
J

Jon.NET

Hi,

Answered my own Question - I select the Field, then get the Current
Selection Range.

Jon
 
F

fumei via OfficeKB.com

I do not understand the reference to Fields, and Bookmarks.

Fields (AUTHOR, NUMPAGES, SUBJECT, SECTIONPAGES etc.) do not have Bookmarks.

FORMFields do have Bookmarks.

if you are talking about formfields, then you do not need to select it.

MsgBox ActiveDocument.FormFields("Text2").Range.Start & _
" " & ActiveDocument.FormFields("Text2").Range.End

Or, if you are commonly dealing with a specific formfield, then make an
object of it:

Dim oFF As FormField
Set oFF = ActiveDocument.FormFields("Text2")

MsgBox oFF.Range.Start & " " & oFF.Range.End


Jon.NET said:
Hi,

Answered my own Question - I select the Field, then get the Current
Selection Range.

Jon
Hi there,
[quoted text clipped - 4 lines]
 
J

Jon.NET

Thank you very much for your help Fumei

fumei via OfficeKB.com said:
I do not understand the reference to Fields, and Bookmarks.

Fields (AUTHOR, NUMPAGES, SUBJECT, SECTIONPAGES etc.) do not have Bookmarks.

FORMFields do have Bookmarks.

if you are talking about formfields, then you do not need to select it.

MsgBox ActiveDocument.FormFields("Text2").Range.Start & _
" " & ActiveDocument.FormFields("Text2").Range.End

Or, if you are commonly dealing with a specific formfield, then make an
object of it:

Dim oFF As FormField
Set oFF = ActiveDocument.FormFields("Text2")

MsgBox oFF.Range.Start & " " & oFF.Range.End


Jon.NET said:
Hi,

Answered my own Question - I select the Field, then get the Current
Selection Range.

Jon
Hi there,
[quoted text clipped - 4 lines]
 
Top