title: copy word doc footer to excel using vba
body: <p>Trying to get the footer text in a MS_Word Doc with an excel macro and paste it into an excel sheet. this VBA code works in MS_WORD  but NOT in MS_EXCEL macro. I checked and the section count = 1 in the document.</p>
  
  <pre><code>Dim wdDoc As Object
  Dim h As Object 'Word.HeaderFooter
  Dim docver As String 'Paste this to excel
  
  Set wdDoc = GetObject("D:docname.docx")
  
  With wdDoc
  
      For Each h In .Sections
  
          docver = h.Footers(wdHeaderFooterPrimary).Range.Text
  
      Next
  
  End With
  </code></pre>