Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-27-2012, 04:53 PM
okiegirl okiegirl is offline Displaying pictures from a field with a file path Windows 7 32bit Displaying pictures from a field with a file path Office 2010 32bit
Novice
Displaying pictures from a field with a file path
 
Join Date: Jul 2012
Posts: 4
okiegirl is on a distinguished road
Default

I finally found what works. I inserted the following into Access 2010 that will run when a command button is clicked in an Access form. The code will open the word document that I already have set up and insert the picture, resize it, and add a border around the picture.


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
Dim newPicture As InlineShape
Selection.GoTo what:=wdGoToBookmark, Name:="Picture"
Set newPicture = Selection.InlineShapes.AddPicture(FileName:=Me.Photo1, _
  LinkToFile:=False, SaveWithDocument:=True)
With newPicture
  .LockAspectRatio = msoTrue
  .Height = 252
  .Width = 410.25
  With .Borders(wdBorderBottom)
    .LineStyle = wdLineStyleSingle
    .LineWidth = wdLineWidth100pt
    .Color = wdColorBlack
  End With
  With .Borders(wdBorderTop)
    .LineStyle = wdLineStyleSingle
    .LineWidth = wdLineWidth100pt
    .Color = wdColorBlack
  End With
  With .Borders(wdBorderLeft)
    .LineStyle = wdLineStyleSingle
    .LineWidth = wdLineWidth100pt
    .Color = wdColorBlack
  End With
  With .Borders(wdBorderRight)
    .LineStyle = wdLineStyleSingle
    .LineWidth = wdLineWidth100pt
    .Color = wdColorBlack
  End With
End With
End Sub

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

Tags
mail merge problem, pictures



Similar Threads
Thread Thread Starter Forum Replies Last Post
Displaying pictures from a field with a file path File Path for Outlook 2007 pst eliz.bell Outlook 2 10-29-2011 07:04 PM
Displaying contact pictures in e-mail header christer Office 0 10-03-2011 09:40 AM
Modify default template to include file path jacl Excel 1 03-26-2011 10:24 AM
Show Full File Path in Title Bar paulj Excel 3 02-10-2010 07:18 AM
Displaying pictures from a field with a file path get file name without Path Ziggy1 Word VBA 1 09-29-2006 07:55 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:04 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft