Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to create a report using Word and WIN32::OLE I have been racking my brains trying to find some documentation on how to INSERT a table in the MIDDLE of the document. Every example I have found creates a table starting at record 0 of the document. I need to INSERT a table after 5 or 6 lines. Can anyone help me !!! The following example starts the table at line 0 I need a report that has a Report Title, then inserts the table after the title: This example doesn't work right. It starts the table at line 0.
my $MyRange = $Word->ActiveDocument->Content; $Word->ActiveDocument->Tables->Add({ Range => $MyRange, NumRows => 5, NumColumns => 4, });
Can anyone help me !!! sr_sager@yahoo.com

edited: Sat Jul 27 22:11:04 2002 by jeffa - added code tags

Replies are listed 'Best First'.
Re: Creating a Table in Word
by dws (Chancellor) on Jul 28, 2002 at 03:13 UTC
    I am trying to create a report using Word and WIN32::OLE I have been racking my brains trying to find some documentation on how to INSERT a table in the MIDDLE of the document.

    Open the word document, and start recording a macro. Position to where you want to create the table, and insert it. Then stop the macro and edit it. You should be able to reverse-engineer the macro (a VBA script), and convert it into the appropriate Perl/OLE calls.