

Sub Insert_picture_To_Bookmark()ĪctiveDocument.Bookmarks("bookmark_logo"). 20210316 With multiple output targets, such as html and latex, we need a little care in ensuring each is supported. I have no idea what you you mean with 'static google map' (in comment), you didn't provide any example therefore you need to make your own test.īefore you run this for test be sure you have two bookmarks in your active document: bookmark_logo and bookmark_poland. But will not work with url of active google map.
#MICROSOFT WORD INSERT IMAGE VIA URL CODE#
If so, there would be quite simple code which would allow you to load picture from web to bookmark in your word document.īelow is the code I have tested with half of success. I assumed that you have knowledge and code to take both bookmark name and url from your database using VBA. To be honest I still don't know where is exactly your problem. I have also checked the bookmark data and it is correct and yes it is a valid URL because if I copy and paste it from the database in the way I described above it works. The URL is a microsoft word bookmark that I get from my database.įor some reason this does not want to work. Now I want to do exactly that with one exception. By default, the name of your Word document will. Then, type a name for your page into the File Name box.

In the Save As window, navigate to where you’d like to store your file. On the File menu, choose the Save As command, and then click the Browse option. Select Google Selection.Text ActiveDocument.Bookmarks ( 'MAPURL' ). Google, True, True End Sub Be aware to have the placeholder bookmark only covering the url, and nothing else. You can do this in alot of different ways I know.įor instance using Quick Parts and the selecting IncludePicture you would the past the URL of the picture and BAM image inserted. First, open up the document you’d like to save as a web page. Sub Insertpicture () Dim Google As String ActiveDocument.Bookmarks ( 'MAPURL' ). I have been Googleing and have not found anything that works. I have tried Quick Parts - IncludePicture (does not work). I have tried hyperlink (does not work and does not display image). Now I want to use the image URL that is passed from the database to insert an image. Under Link to, select Existing File or Web Page. In the Links group, click Link or Hyperlink. I create a bookmark for that column in the word document (this works fine). To insert a hyperlink to an existing file: Click where you want to insert a hyperlink or select the text, shape or image you want to use as a hyperlink. I have a image URL contained in my sql database.
