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!

DAO in Word to retrieve picture from Access - Help!

Status
Not open for further replies.

Turpis

Programmer
Apr 16, 2002
151
I have an application that I build awhile back that uses DAO to retrieve Access data to create documents. I now need to add some pictures into the fray. The database if fine, but I can't seem to get the VBA coding to pull the picture. Here is what I have tried:

With Selection
.TypeText "Thank You,"
.TypeParagraph
.TypeParagraph
.TypeText rsSign("UserName").Value
("UserExt").Value
.TypeParagraph
.InlineShapes.AddPicture rsSign("UserSignature").Value
.HomeKey wdLine
.MoveEnd wdLine, wdExtend
.Font.Name = "Arial"
.Font.Size = 12
.EndKey wdLine
.TypeParagraph
.TypeText rsSign("emailaddress").Value
End With

Any suggestions on the proper way to insert that picture would be appriciated (for DAO, I am not rewriting the application). I am pretty sure that I have tried all the methods and properties of the recordset.fields object, but then I am no expert.


Charles
Quality Assurance/Office Developer
Walden's Machine, Inc.
Tulsa, Ok.
 
Please...anybody? I promise I will never ask for help again (crossing fingers behind back).

Charles
Quality Assurance/Developer
 
Charles,

I am in the same boat. I need to add a graphic image to the top of a Word document using data from an Access database using VBA. I have a graphic image loaded as an OLE object and need to move it from the recordset to the AddPicture command. Were you at all successful?

Thanks,
Mickey Ruslavage
Military Sealift Command
Virginia Beach, VA
 
Sorry Mickey,
No, my weekend long study into the subject resulted in failure. It seems that you can't accomplish this task in VBA. It can be done in VB with the common dialog control quite easily. I was able to find and create code that could take the BLOB and relocate it within the database and also take a BLOB and copy it in and out of the database. I just could never get it out of the recordset into an object that VBA would allow me to paste or insert into the document.

The suggestion that I found on many threads was to simply insert a path in the database field, to a folder that contains the pictures. Seems a little silly, but it is only a limitation of VBA.

Charles
Quality Assurance/Developer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top