Add logo to Word based on client number in Access

SkylabOne

New Member
Joined
Oct 22, 2013
Messages
21
Dear all,

My Access database is connected to my Word application and upon opening the document a pop-up asks to select a client number to fill the bookmarks. The data contains things like company name, address, e-mail, website.

My problem: I'd like to add a client logo to the form

1.) I believe I have to add the image in my Access database as an attachment.
2.) Then the image should be loaded into Word dependent on what client is selected. I believe this is done with a bookmark, but I do not know how to do this with images.

Code:
<code style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif;">[COLOR=gray]'Establish connection
[/COLOR][COLOR=#00008B]Set[/COLOR] dbs = OpenDatabase(ActiveDocument.Path & [COLOR=#800000]"\Contacts.accdb"[/COLOR])
[COLOR=gray]
'Fill recordset with data matching the text of combo cboContacts[/COLOR] 
[COLOR=#00008B]Set[/COLOR] rst = dbs.OpenRecordset([COLOR=#800000]"Select * FROM Contacts WHERE Company = '"[/COLOR] & _                        
[COLOR=#00008B]             Me[/COLOR].cboContacts.Text & [COLOR=#800000]"';"[/COLOR])
[COLOR=gray]
'Write values of Recordset fields to bookmarks in the document
[/COLOR][COLOR=#00008B]Call[/COLOR] FillBookmark([COLOR=#800000]""[/COLOR] & rst.Fields([COLOR=#800000]"Company"[/COLOR]), [COLOR=#800000]"bmCompany"[/COLOR])
[COLOR=#00008B]Call[/COLOR] FillBookmark([COLOR=#800000]""[/COLOR] & rst.Fields([COLOR=#800000]"Contact_Person"[/COLOR]), [COLOR=#800000]"bmContact_Person"[/COLOR])</code>


Hopefully someone can help. I appreciate your time and suggestions!

Kind regards,
Rolf
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

Forum statistics

Threads
1,223,234
Messages
6,170,891
Members
452,366
Latest member
TePunaBloke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top