I have been using this code for a log time to convert all the fields of the document to just numbers:
Code:
Sub MMD_MakeAllReferencesToJustNumber()
On Error Resume Next
Dim oStoryRng As Range
Dim oFld As Field
For Each oStoryRng In ActiveDocument.StoryRanges
For Each oFld In oStoryRng.Fields
If oFld.Type = wdFieldRef Then
If InStr(oFld.Code.Text, "\# 0;0") = 0 Then
oFld.Code.Text = Replace(oFld.Code.Text, " \h", " \# 0;0 \h")
End If
oFld.Update
End If
Next oFld
Next oStoryRng
End Sub
but if the document is a long one with lots of field, then it takes long time to process all fields every time I run this code, because it updates all fields in the current document.
Now, I am wondering if it is possible to just update all the fields in the current page by changing
Code:
For Each oStoryRng In ActiveDocument.StoryRanges
to something just for the current page. I appreciate your help in this matter.
Thanks,