Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to delete links in Word via a VBA Macro 1

Status
Not open for further replies.

srp2703

Technical User
Sep 29, 2008
1
Wonder if anyone can help. I have developed a routine in Excel and Word VBA that links information from a Sage Accounting system that prodces financial information for a company , then from that prodces individual reports for individual investors in that company via Excel that are then linked out to specific reports in Word that can then be emailed to the investors.

The one stumbling block is that I would like the macro in Word to break the links to Excel and Sage so that what is sent out is just base numbers and I do not get people getting an "update links" message when they open the report.

Unfortunately when I recorded the procedure in a macro it was not recognised and no code was produced for the act of breaking the links. Does anyone kow how to do this via a VBA Macro?

Thanks in advance
 
for each l in thisdocument.hyperlinks
l.delete
next

_________________
Bob Rashkin
 
Hi srp2703,

Unless you only want to unlink hyperlinks, you might do better with something like:

Sub Unlink()
ActiveDocument.Fields.Unlink
End Sub

Cheers

[MS MVP - Word]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top