in reply to Word tables, OLE, perl, and me.

Thanks for all the help folks. Sorry for no reply for a while, I had jury duty on a criminal case basically all last week....

I did get it sorted out, and I did implement a combination of suggestions. I'm using the *Home, *End for selection, and am iteratively moving backwards line by line to find the word I'm looking for. It seems to work out well. It also became useful when another document had a slightly different format w/ multiple tables for a single Table1 heading. Of course, I'm going to have to do this for multiple documents now with differing formats... yay.. Thanks for all the help! example code for those interested:
while ($tablefound == 0){ $word->Selection->MoveUp(wdLine,1); $word->Selection->HomeKey(wdLine); $word->Selection->EndKey(wdLine, wdExtend); my $str = $word->Selection->{Text}; if ($str =~ m/Table (\d+)/){ $tableID = $1; $tablefound = 1; } }

Replies are listed 'Best First'.
Re^2: Word tables, OLE, perl, and me.
by kowshik (Initiate) on Mar 18, 2009 at 07:24 UTC
    I Am using your method to get the Data from MSWROD Table. But am facing same problem, Excel cells are merged for WrapText if i export MSWORD Table into an Excel file. I think you have done some thing to get it as UnMerged. Could you please post that part of Code. If possible can you give your mail Id also. Mine Kowshik.S@KPITCummins.com