K
Kevin
I have a number of fields in my documents routinely. They are Table
references, FIgure References, etc. that are automatically numbered as well
as the Table of Contents. If I delete say a table in the middle of a
partially drafted document the tables below the point where I deleted the
table do not renumber. I use the following code to renumber all numbered
objects in my document:
Dim fldLoop As Field
Dim myCount As Integer
myCount = 1
For Each fldLoop In ActiveDocument.Fields
fldLoop.Select
Selection.Fields.Update
myCount = myCount + 1
Next fldLoop
MsgBox "Done!," & myCount & "Fields updated"
This works fine for what it is intended to do but it takes the focus in the
document to the last field renumbered which takes me away from the part of
the document I am working on. This is not a problem if the document is short,
but can be a real pain in the rump if the document is long. Is there a way to
determine the current location within my document and return there when done.
FYI... I tried a slightly different script which used the collection and did
not change the current location, but it would not work. Nothing was updated.
Thanks in advance for the help!
references, FIgure References, etc. that are automatically numbered as well
as the Table of Contents. If I delete say a table in the middle of a
partially drafted document the tables below the point where I deleted the
table do not renumber. I use the following code to renumber all numbered
objects in my document:
Dim fldLoop As Field
Dim myCount As Integer
myCount = 1
For Each fldLoop In ActiveDocument.Fields
fldLoop.Select
Selection.Fields.Update
myCount = myCount + 1
Next fldLoop
MsgBox "Done!," & myCount & "Fields updated"
This works fine for what it is intended to do but it takes the focus in the
document to the last field renumbered which takes me away from the part of
the document I am working on. This is not a problem if the document is short,
but can be a real pain in the rump if the document is long. Is there a way to
determine the current location within my document and return there when done.
FYI... I tried a slightly different script which used the collection and did
not change the current location, but it would not work. Nothing was updated.
Thanks in advance for the help!