I am parsing a word 2007 using powershell. I would like get each table's caption and print it to screen.
Here is an idea of what I would like to do, but the print caption line does not work.
$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
}
}
Is it possible to get the caption associated with a table?