title: Inserting a picture at a bookmark (OR how to tell if any list box items have been selected)
body: <p>I'm new to VBA and still struggling a lot.</p>
  
  <p>I have a list object on a useform that is populated with the file-names of the contents of the relative ".\logos\" directory. I want to insert the picture at a bookmark named <code>bmLogo</code>, but the code I've written (see below) doesn't do the trick.</p>
  
  <pre><code>If ListLogo &lt;&gt; Null Then
      ActiveDocument.Bookmarks("bmLogo").Range _
          .InlineShapes.AddPicture FileName:=ThisDocument.Path &amp; "\logos\" &amp; ListLogo
  End If
  </code></pre>
  
  <p>Any tips? Also, if I could set a height and have the image scale to it without changing the aspect ratio that would be very useful!</p>
  
  <p>Thanks,<br>
  Louis</p>
  
  <p>EDIT 1: Right, so, bmLogo is the correct name of the bookmark, so that's not the problem.
  I just used a msgbox to display '"path: " &amp; ThisDocument.Path &amp; "\logos\" &amp; ListLogo' and it looks like the correct path. I'm using ThisDocument.Path as I want it to be relative so the document is more portable. I think I'll try with an absolute path for the time being and seeing if that work, if nothing else it should hint at where the bug is not.</p>
  
  <p>EDIT 2: It works with an absolute path outside the IF statement and when I get a msgbox to print both the absolute and relative path they are identical. After commenting out the IF statement the relative method works find. I'm glad that it's working now but can anyone tell what the issue is with the IF? </p>
  
  <p>EDIT 3: It turns out that my method for checking if something has been selected in the list box doesn't work at all. Instead I shall be iterating through each item in the list and checking if that one is selected. It's a pretty crude method but it'll do until I can find a better one.</p>