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.
Hopefully someone can help. I appreciate your time and suggestions!
Kind regards,
Rolf
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