Field Update in Footer

D

Dan

Hi,

I have a macro set up that updates the document version field in the footer of the document. This was working fine until I changed the text in the footer to a table in the footer. Now when you run the macro it doesn't update the version on screen but it does get updated if you go to print preview. Does anyone know why and know how to change the script so the screen updates whenever the macro is run? I am currently using the following script to update the version.

thanks

Dan

For Each prop In ActiveDocument.CustomDocumentProperties
If prop.Name = "Version" Then
prop.Value = prop.Value + 0.01

End If
Next
For Each aField In ActiveDocument.Fields
If StrComp(aField.Code.Text, " DOCPROPERTY Version \* MERGEFORMAT ") = 0 Then
aField.Update
End If
Next aField

Dim oSec As Section
Dim oFoot As HeaderFooter

For Each oSec In ActiveDocument.Sections
For Each oFoot In oSec.Footers
oFoot.Range.Fields.Update
Next oFoot
Next oSec

End Sub
 
W

Word Heretic

G'day Dan <[email protected]>,

In word 2k I use a View > Normal and a View > Print Layout to achieve
this.

Steve Hudson
Word Heretic Sydney Australia
Tricky stuff with Word or words

Email: WordHeretic at tpg.com.au


Dan was spinning this yarn:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top