View Single Post
 
Old 07-27-2012, 07:34 AM
okiegirl okiegirl is offline Windows 7 32bit Office 2010 32bit
Novice
 
Join Date: Jul 2012
Posts: 4
okiegirl is on a distinguished road
Default

OMG! Yea, I figured out how to get the picture in, the only problem now is to get the picture to insert in the location I want. Here is how I fixed the issue:

I recorded a macro of me inserting the picture and then I took the recorded macro and copied and pasted it into the event behind the command button in Access that performs the mail merge where it would run right after it opens the Word document. Worked great! Now I just need to figure out how to make the picture come in sized 3.5 x 5.7 and on the 3rd line with a border. Does anyone know how I can modify the below VB to do this type of formatting?

Here is my modified code that brings the picture in:
Code:
Private Sub Command127_Click()
 
'generates the individual comp template for the current record
LOCAL_TEMPLATE = Me.txtCompTemplate
 
'SEE IF THE TEMPLATE IS OPEN
DoCmd.SetWarnings False
 
'THIS QUERY CREATES A TEMP TABLE FOR THE MERGE
DoCmd.OpenQuery "qryCompData", acViewNormal
Call OPEN_WORD_MERGE_DOC(LOCAL_TEMPLATE)
 
'This is a copy of the Word macro to bring in the picture
'Will need to change Filename to a field from Access, this was to see if it worked
Selection.InlineShapes.AddPicture Filename:="K:\AC_CompPics\210019544.jpg" _
, LinkToFile:=False, SaveWithDocument:=True
 
End Sub
Thanks a million!

Last edited by macropod; 07-28-2012 at 01:32 AM. Reason: Added Code Tags
Reply With Quote