title: Generate bookmarks programmatically based on locations denoted by section number
body: <p>I have an HTML page with links that when clicked open to a specific bookmark in a word document. I am working with an existing word 2003 document with no preexisting bookmarks. I want to add bookmarks  to all section number header locations using a macro or a VBA script. Example</p>
  
  <blockquote>
    <p>3.1.4.2 HERE<br>
          STUFF<br>
      3.1.4.2.1 Here again<br>
           MORE STUFF<br>
      3.1.4.2.1.1   Here again again<br>
          EVEN MORE STUFF<br>
      3.1.4.2.2  Here again again again<br>
          LOTS MORE STUFF      </p>
  </blockquote>
  
  <p>I want to bookmark all the lines that start with X.X.X... 
  with  a standard format for the name.</p>
  
  <p>Example (using above as reference)</p>
  
  <p>3.1.4.2 HERE line would have a book mark named M_3_1_4_2<br>
  3.1.4.2.1 Here again would have a book mark named M_3_1_4_2_1  </p>
  
  <p>etc.</p>
  
  <p>My question is what approach with a VBA script or a macro would I need to take that would make this happen.</p>