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
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