I work on this code to change the sources of all linked Fields/Charts/... in Word templates to the workbook it is launched from.
I had usual
Maybe not all Fields/Shapes are linked and the original insert of the field/shape resulted in not all properties being created on the object.
To advance your code and find out in more detail what is the matter with the objects, try to ignore and report errors. Use watches to inspect the objects.
For example:
On Error Goto fieldError
For Each aField In oDoc.Fields
With aField
.LinkFormat.AutoUpdate = False
DoEvents
.LinkFormat.SourceFullName = NewLink
.Code.Text = Replace(.Code.Text, Replace(.LinkFormat.SourceFullName, "\", "\\"), Replace(NewLink, "\", "\\"))
Goto fieldContinue
fieldError:
MsgBox "error: "
fieldContinue:
End With
Next aField
P.s.: what is the purpose of DoEvents
? That will process external events (Windows messages).