B
Bear
Hello:
I have a question about this code:
Sub RefFieldUpdateAllStory()
' Written by Charles Kyle Kenyon 15 November 2001
' repaired with help from Jezebel 10 December 2004
' All Story Field Updater - Ref fields
Dim oField As Field
Dim oStory As Range
For Each oStory In ActiveDocument.StoryRanges
' This goes into headers and footers as well as the regular document
Do
For Each oField In oStory.Fields
If oField.Type = wdFieldRef Then
oField.Update
End If
Next oField
Set oStory = oStory.Next
Loop Until oStory Is Nothing
Next oStory
End Sub
I'm curious about the Do ... Until oStory Is Nothing loop. Isn't this
functionality inherent in the For Each oStory loop?
I mean, wouldn't this work?
Sub RefFieldUpdateAllStory()
Dim oField As Field
Dim oStory As Range
For Each oStory In ActiveDocument.StoryRanges
For Each oField In oStory.Fields
If oField.Type = wdFieldRef Then
oField.Update
End If
Next oField
Next oStory
End Sub
I'd really like to know...
Bear
I have a question about this code:
Sub RefFieldUpdateAllStory()
' Written by Charles Kyle Kenyon 15 November 2001
' repaired with help from Jezebel 10 December 2004
' All Story Field Updater - Ref fields
Dim oField As Field
Dim oStory As Range
For Each oStory In ActiveDocument.StoryRanges
' This goes into headers and footers as well as the regular document
Do
For Each oField In oStory.Fields
If oField.Type = wdFieldRef Then
oField.Update
End If
Next oField
Set oStory = oStory.Next
Loop Until oStory Is Nothing
Next oStory
End Sub
I'm curious about the Do ... Until oStory Is Nothing loop. Isn't this
functionality inherent in the For Each oStory loop?
I mean, wouldn't this work?
Sub RefFieldUpdateAllStory()
Dim oField As Field
Dim oStory As Range
For Each oStory In ActiveDocument.StoryRanges
For Each oField In oStory.Fields
If oField.Type = wdFieldRef Then
oField.Update
End If
Next oField
Next oStory
End Sub
I'd really like to know...
Bear