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

Insert image to a Word Template

Status
Not open for further replies.

thatguy

Programmer
Aug 1, 2001
283
US
I'm wondering if it's possible to insert an image into a placeholder in a Word template (from Access).

I have several fields (using custom document properties) such as name, employee title, dept, etc, that I insert with no problems, but I also need to add in a link to an employee picture (linked to a jpg on the network) -- and the picture needs to be in a specific place in the doc.

I've tried using a bookmark, which just generates an error.

Any thoughts?

Thanks

 
Sorry bout that.. here's the code..

Code:
    Set oWord = CreateObject("Word.Application")
    Set oDoc = oWord.Documents.Open(cfile)
    oDoc.Bookmarks("bkImage").Select
    oWord.Selection.InlineShapes.AddPicture _
        "C:\Photos\Test.jpg", True, False

And the error that pops up is:

Run-time error '-2147467259 (80004005)':

Method 'AddPicture' of object InlineShapes' failed.


Any thoughts?

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top