Word Automation

K

kris

Hi

I want to link images and other files (.xsl, .txt etc.) in my word document
programatically, i.e., the word document should not have those documents in
it but should only have links to those files and should be able to display
them using those links. All this i need to do with word automation.

Thanks and Regards
M. Srujana
 
S

Sam Hobbs

I don't know the answer but I do know how to search. Look at the
AddOLEObject method; I don't know if it will do what you need to do but it
looks to me that it is worth a look.

Before asking how to use AddOLEObject, look for articles about it and
samples of it.
 
C

Cindy M.

Hi Kris,
I want to link images and other files (.xsl, .txt etc.) in my word document
programatically, i.e., the word document should not have those documents in
it but should only have links to those files and should be able to display
them using those links. All this i need to do with word automation.
Word handles these two file types differently. In the one case, an IncludeText
field is created, in the other a Link field. The object model uses InsertFile
and AddOLEObject, but I find these more troublesome than actually creating the
field code.

So, insert the objects with a link, then press Alt+F9 to toggle the field
codes on. Note the syntax of the field code, which you can then use with the
Fields.Add method of the Document object.

Important note: with the exception of inserting a graphic (IncludePicture
field) the information in embedded objects will be saved in the document.
Linking will have NO affect on the file size. The IncludePicture field does
have an optional switch that lets you exclude the information from the
document.

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

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