G
gkbrenne
I have an document that contains links to an Excel spreadsheet. These links
need to be updateable while the document is being editing and the spreadsheet
data may be changing.
The last step in the process is to create the final document, which would
break the links to the Excel spreadsheet.
I've tried using the following:
Dim alink As Field, linkcode As Range
For Each alink In ActiveDocument.Fields
With alink
If .Type = wdFieldLink Then
.LinkFormat.BreakLink
End If
End With
Next alink
Which breaks the link, but loses the format.
However, if I do it manually I can keep the formatting (Office button >
Prepare > Edit Links to file, check "Preserve Formatting after update", then
click [Break Link]).
Any ideas on how to do this using VBA?
need to be updateable while the document is being editing and the spreadsheet
data may be changing.
The last step in the process is to create the final document, which would
break the links to the Excel spreadsheet.
I've tried using the following:
Dim alink As Field, linkcode As Range
For Each alink In ActiveDocument.Fields
With alink
If .Type = wdFieldLink Then
.LinkFormat.BreakLink
End If
End With
Next alink
Which breaks the link, but loses the format.
However, if I do it manually I can keep the formatting (Office button >
Prepare > Edit Links to file, check "Preserve Formatting after update", then
click [Break Link]).
Any ideas on how to do this using VBA?