I have a Word document that has links to an Excel spreadsheet.
I want to break the Excel links using VBA. I have tried most suggestions
posted on the web but nothing suits and I am struggling!
Can anyone suggest some code to achieve this?
Thanks
Martyn
Hi =?Utf-8?B?Sm9uZXN5IEJveQ==?=,
> I have a Word document that has links to an Excel spreadsheet.
> I want to break the Excel links using VBA. I have tried most suggestions
> posted on the web but nothing suits and I am struggling!
> Can anyone suggest some code to achieve this?
It would help us a lot if you'd post URLs to the methods you've tried, or
if you'd list them. You also need to tell us
- the version of Word involved
- whether the Excel objects in question are formatted in-line with the
text, or with text flow formatting
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org
This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)
Dim af As Field
With ActiveDocument
For Each af In .Fields
If af.Type = wdFieldLink Then
af.Unlink
End If
Next af
End With

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
>I have a Word document that has links to an Excel spreadsheet.
> I want to break the Excel links using VBA. I have tried most suggestions
[quoted text clipped - 3 lines]
> Thanks
> Martyn
Jonesy Boy - 17 May 2006 17:21 GMT
Cheers Doug - pure genious!
Works a dream, thank you very much.
Jonesy
> Dim af As Field
> With ActiveDocument
[quoted text clipped - 12 lines]
> > Thanks
> > Martyn