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

Photo in Word

Status
Not open for further replies.

matrixindicator

IS-IT--Management
Sep 6, 2007
418
BE
Hey,

I know this is an access VBA forum, access vba provide some ways with vba to interchange data with other ms programmes.

I have an access.mdb. In it there is a report with images per page. The photo's are not included, but linked along a URL in a table eg. C:\PHOTO\124645.jpg. It works fine !

Now we like to export some data to a word document (I know more or less how to, no problem).

I just want some advice on how to say or what to do to include (not linking) the selected photo's in the word document. This document can be send as an attachement. The photo's are these which are used in my mdb and stocked in a simple folder C:\PHOTO



 
Try the below

Dim ImagePath as string

ImagePath = "C:\PHOTO\124645.jpg"

If Dir$(ImagePath) <> "" Then
objWord.Selection.InlineShapes.AddPicture FileName:=ImagePath, LinkToFile:= _
False, SaveWithDocument:=True
With .InlineShapes(1)


' Set to the size you require
.Height = 339
.Width = 411

End With
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top