Problem driving Word from Access

J

Jeff Stroope

Hello,

I have been learning to control Excel and Word from Access using VBA and
references to these two apps. I've had pretty good success, but I ran into
one, stubborn problem. My Access application uses the TransferSpreadsheet
method to populate some Excel worksheets. It then opens Word docs that have
tables which are linked to those Excel worksheets. After all that happpens,
I need to save the Word docs under a different name and break the links to
the Excel worksheets. I got the first part with this code:
ActiveDocument.SaveAs ("Copy of Document Name"). But I can't figure out how
to break the links in the Copy of document. Can anyone help?

Thanks, Jeff.
 
D

Doug Robbins

Dim afield As Field
For Each afield In ActiveDocument.Fields
afield.Unlink
Next afield

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

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