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

I am trying to create a MSWord report using OLE. The report consists of a Title and a Table below the title. My Results: I can add a Title or I can add a Table, however I cannot add a Title and a Table on the same page. My results end up with either the Title or the Table at the top of the page but not formatted with the Table below the Title. If you can help me I would sincerely appreciate it!!

Replies are listed 'Best First'.
Re: Word Doc Using OLE
by cacharbe (Curate) on Aug 08, 2002 at 19:36 UTC
    It's like deja vu. I just answered this exact same question.

    Now, what have you tried? Simmer it down on medium heat and show us a reduced version of what is failing (But make sure to read the link, first).

    update:
    Here's a hint: $MyRange->Collapse({Direction=>wdCollapseEnd});

    C-.

    ---
    Flex the Geek

Re: Word Doc Using OLE
by Jenda (Abbot) on Aug 08, 2002 at 20:26 UTC

    Not exactly an answer to your question but ... what about using RTF instead of the binary Word format? There are some RTF modules on CPAN or you may try my Template::RTF. That would allow you to create a template in MSWOrd, save it as RTF and then process it with a script and fill in variables. The module even allows you to repeat parts of the template if you need.

    I discontinued the development since I did not need the functionality anymore and noone seemed to be interested, but it was in a working state and I did use it in production.

      HTH, Jenda

Re: Word Doc Using OLE
by traveler (Parson) on Aug 08, 2002 at 21:31 UTC
    I agree with cacharbe, more info is needed. However, I've done it by setting up a Range and using InsertAfter. So, in the true Perl fashion TIMTOWTDI. Let us see you code and maybe we can help.

    HTH, --traveler