Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Field Codes 1

Status
Not open for further replies.

wtrhzrd

Programmer
Oct 23, 2002
8
US
Does anyone know how to search the field codes in a microsoft word document? Can you use VB or something? I want to do something similar to the way MS Word sets up an index but with a few modifications. Any comments would be appreciated
 
If you go to Edit Find, click More, click Special, you should be able to search for a field one at a time.
 
Thanks! I didn't know that was there. Now I want to be able to do that in code. VB or something. Is this possible?
 
This will pop a message box for each Field in your document:

Sub fields()

Dim oField As Field

For Each oField In ActiveDocument.Fields
MsgBox oField.Code.Text
Next oField

End sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top