J
JAG777
I have a word template which has a number of graphs (wdfieldlinks created by
inserting manual Excel graph links with copy/paste special/link) and
variables taken from a user form (wdfielddocvariable).
I have tried a number of ways to get the newly created word doc to update
the graphs and docvariables, and then break the links - but have reached a
dead-end.
The unlink method, if sent to the fields property of the active document,
appears to stop the update method for wdfieldlinks, but not
wdfielddocvariables - so I end up with a doc that has incorrect graphs - but
correct, updated data. So, I have used the following code after the general
update command in order to break the links / unlink the links by field type:
Activedocument.fields.update
For Each fldElement In .Fields
Select Case fldElement.Type
Case wdFieldLink
fldElement.LinkFormat.BreakLink
Case Else
fldElement.Unlink
End Select
Next
This gives me the error 4198.
I am new to VBA programming and am learning from books (which I'm finding
can be quite vague) so apologies if this is an elementary problem. Any help
would be very gratefully received.
jag777
inserting manual Excel graph links with copy/paste special/link) and
variables taken from a user form (wdfielddocvariable).
I have tried a number of ways to get the newly created word doc to update
the graphs and docvariables, and then break the links - but have reached a
dead-end.
The unlink method, if sent to the fields property of the active document,
appears to stop the update method for wdfieldlinks, but not
wdfielddocvariables - so I end up with a doc that has incorrect graphs - but
correct, updated data. So, I have used the following code after the general
update command in order to break the links / unlink the links by field type:
Activedocument.fields.update
For Each fldElement In .Fields
Select Case fldElement.Type
Case wdFieldLink
fldElement.LinkFormat.BreakLink
Case Else
fldElement.Unlink
End Select
Next
This gives me the error 4198.
I am new to VBA programming and am learning from books (which I'm finding
can be quite vague) so apologies if this is an elementary problem. Any help
would be very gratefully received.
jag777