-
Tinbendr, you forgot to do the file saving instruction!
That would do the update...but NOT do the actual saving of the file. The file would NOT be saved.
I am not a fan of going through all the StoryRanges, unless actually needed. Going through all the StoryRanges means looping through (assuming there are no Comments, or Endnotes):
MainTextStory
EvenPagesHeaderStory
PrimaryHeaderStory
EvenPagesFooterStory
PrimaryFooterStory
FirstPageheaderStory
FirstPageFooterStory
in that order. Since (again assuming you do NOT want to check through the Comments story, the EndNotes Story, the FootNotesStory or the TextFrameStory....then why not just action the stories you weant to explicitly?
[vba]
Sub FileSave()
Dim oHF As HeaderFooter
Dim oSection As Section
Dim rngStory As Range
For Each oSection In ActiveDocument.Sections
For Each oHF In oSection.Headers
oHF.Range.Fields.Update
Next
For Each oHF In oSection.Footers
oHF.Range.Fields.Update
Next
Next
With ActiveDocument.Range
.Fields.Update
End With
ActiveDocument.Save
End Sub
[/vba]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules