title: powershell - MS-Word document parsing - Get a table's caption text
body: <p>I am parsing a word 2007 using powershell. I would like get each table's caption and print it to screen.</p>
  
  <p>Here is an idea of what I would like to do, but the print caption line does not work.</p>
  
  <pre><code>$wd = New-Object -ComObject Word.Application
  $wd.Visible = $true
  $doc = $wd.Documents.Open($filename)
  foreach ($table in $doc.Tables)
  {
        #print table caption
        Write-Host $table.Caption.Range.Text #This does not work
  
        #Print Table contents
        foreach ($row in $table.Rows)
        {
            Write-Host $row.Range.Text
        }
  }
  </code></pre>
  
  <p>Is it possible to get the caption associated with a table?</p>