Reputation: 1
I'm trying to use a macro to embed linked images in a Word doc.
When I get to the line that breaks the link, I keep getting this error: Run-time error 5352 The link does not exist
This is the bit of code I'm using to break the link:
For Each objField In ActiveDocument.Fields
If Not objField.LinkFormat Is Nothing Then
objField.LinkFormat.BreakLink
ActiveDocument.UndoClear
End If
Next
Any ideas why this isn't working? I can't see why I would get this error.
Upvotes: 0
Views: 705
Reputation: 1
I found the solution - refresh the image before trying to break the link:
For Each objField In ActiveDocument.Fields
If Not objField.LinkFormat Is Nothing Then
objField.LinkFormat.Update
objField.LinkFormat.BreakLink
ActiveDocument.UndoClear
End If
Next
Upvotes: 0