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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

docVariables

Status
Not open for further replies.

JPD3

Programmer
Feb 12, 2002
13
0
0
US
I have used docVariables in a Word document with VB6 without any problem until I needed to put 2 of them in the header of the document. It simply doesn't update when I run: docFile.Fields.Update

I can right click on them in the header and select Update and it does display the value. So, I know they are there. But, in VB it ignores it. I don't get an error.

Anyone have any ideas?
 
You may try something like this:
For Each myStoryRange In ActiveDocument.StoryRanges
myStoryRange.Fields.Update
While Not (myStoryRange.NextStoryRange Is Nothing)
Set myStoryRange = myStoryRange.NextStoryRange
myStoryRange.Fields.Update
Wend
Next myStoryRange

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top