I have read everything that I could find about win32::OLE to accomplish this task. I am trying to pull table data from a word document and place it in an excel spreadsheet. I have found many examples of adding data to an excel spreadsheet using win32::OLE, so I feel I can accomplish the second task.
I have read the OLE browser info on my windows computer and I installed and looked at Microsofts own oleview.exe information trying to understand how to get table data. Table data in the context that I am using it in means the text and formatting information about the table.
I am able to get table text but my goal is to get all the table information, windows formatting included. I think! Anyway this is what I have.
#!/usr/bin/perl
use warnings;
use strict;
use Win32::OLE;
### File containing tables
my $file = "C:\\DocParse\\test.doc";
### Open for reading
my $word = Win32::OLE->new('Word.Application', 'Quit') or die;
my $readdoc = $word->Documents->Open({FileName=>$file});
my $output = $readdoc->Tables()->Count();
print "There are $output tables.\n";
### read text from the document and print to the console
my $tables = $readdoc->Tables;
foreach my $table (in $tables) {
print $table->Range->{Text};
If there is anyone out there that could at least point me to the correct methods or properties that I should use to get the data that i need.
Thanks Bob
I got 99 problems, but a @%$()_ ain't one.