Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub UpdateDocument()
- Dim oStory As Range
- Dim oTOC As TableOfContents
- Dim oTOF As TableOfFigures
- For Each oStory In ActiveDocument.StoryRanges
- oStory.Fields.Update
- If oStory.StoryType wdMainTextStory Then
- While Not (oStory.NextStoryRange Is Nothing)
- Set oStory = oStory.NextStoryRange
- oStory.Fields.Update
- Wend
- End If
- Next oStory
- For Each oTOC In ActiveDocument.TablesOfContents
- oTOC.Update
- Next oTOC
- For Each oTOF In ActiveDocument.TablesOfFigures
- oTOF.Update
- Next oTOF
- ActiveDocument.Save
- End Sub
Add Comment
Please, Sign In to add comment