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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to insert files in a worddoc?

Status
Not open for further replies.

checkOut

Technical User
Oct 17, 2002
153
NL
I made up a word_template and need to set pictures in it on bookmarked places, but how can I do this?

Thanx in advance,

Gerard
 
I'll try this, because the picture has to come up in a column in mytable:

mytable.Cell(rij, 4).Range.InsertFile "C:\wolk.jpg"

but this gives 199 pages with @#@$#$#!@##@ in the column instead of a friendly, little cloud....

 
hi there

try this:
[tt]
'to select the cell within the table, e.g.
activedocument.Tables(1).Cell(1,1).Select

'add the image file
Selection.InlineShapes.AddPicture FileName:= _
"E:\myFile.gif" _
, LinkToFile:=False, SaveWithDocument:=True
[/tt]

however, if you have pre-defined bookmarks then to add an image at the bookmark, use the bookmark collection:
[tt]
activedocument.Bookmarks("myBookmark").Range.InlineShapes.AddPicture FileName:= _
"E:\myFile.gif" _
, LinkToFile:=False, SaveWithDocument:=True

[/tt]

Hope this helps
Cheers,
Dan
 
I tried the code above. It looks well and I think it works, but I get errormsg: not finding external server (462). Can't understand this. First time he's inserting the file, but after this he can't find an external server. I never need an external server.

Somebody understand this problem?

gerard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top