title: Generate bookmarks in Word 2010 programmatically, with the header name as the bookmark name
body: <p><img src="https://i.imgur.com/Kax5D.jpg" alt="Picture of the document"></p>
  
  <p>I need to generate bookmarks in Word 2010 programmatically, with the header name as the bookmark name.</p>
  
  <p>I have the following code which makes a word a bookmark, but the bookmark name remains the same as the string <code>Heading 1</code> is only available in the name variable:</p>
  
  <pre><code>Sub bookmarking()
      Selection.EndKey Unit:=wdLine, Extend:=wdExtend
      With ActiveDocument.Bookmarks
          .Add Range:=Selection.Range, Name:=" Heading 1"
          .DefaultSorting = wdSortByName
          .ShowHidden = False
      End With
  End Sub
  </code></pre>
  
  <p>Instead of the <code>Heading 1</code> in the name variable, I want content from the clipboard. Please help me replace that <code>Heading 1</code> with clipboard content.</p>