How to break textlinks to Excel in WORD2000 by a macro or VBA?

P

Patrick Paluselli

I made a WORD 2000 template in which there are a few textfields that get
there information in cells of an excel file. Once the data is in the WORD
doc, this doc should live is own life without the Excel file.

In a manual way this is easy to perform: select all, edit, links, break link.

When I record these operations, the macro does not register these operations.
Neither does it in a template or a simple .doc file.

Does anyone know a solution? An appropriate VBA code is also OK!

Thanks a lot!

Patrick Paluselli
 
D

Doug Robbins - Word MVP

Try:

Dim afield As Field
With ActiveDocument
For Each afield In .Fields
If afield.Type = wdFieldLink Then
afield.Unlink
End If
Next
End With


--
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
 
P

Patrick Paluselli

Dear Mr.Robbins,

Your advice was very helpfull. It works as I wanted to. Thanks a lot !!!!

Patrick
 
B

Bob

Hey Doug,

Thanks alot for that. I had googled aroung for ages trying to find an
answer to that one.

Anthony
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top