Do a google on Win32:OLE, one site Win32_Perl_Modules. Would also try the Super Search on Monks and would also pay attention to the Active State site. Basically you will find lots of "stuff", which of that "stuff" is the "best stuff", I can't say! I am confident that it is possible for Perl to control WinWord, but I would not underestimate the complexity of the details involved (see below)

What I've described is similar to what will happen with say an RTF file that WordPad generated. WinWord can read those things.

I'm not sure that I understand exactly what you mean by "dynamic". Generation of a .doc file upon a new release of a text file every week is quite a different thing than generating a .doc file that continually changes every second based say upon current weather conditions.

I have generated fancy reports in WinWord from text files before, but not completely automated. The way I did it was create a Word Macro such that I just had to open the text file in Word, then hit say CTL-R (for report) to run the Word macro and then save the resulting file...3 manual steps...took a minute for me to do. This didn't matter as I had to also prepare a management presentation about what the data meant which took hours!

Now that I think about it, this worked amazingly well! I had control of the format of the text file and that enabled me to avoid writing any WinWord BASIC macro code at all! I did it all with just keyboard macro recorder and use of a Word template file that I made...Search for X, change font to Y, assign heading numbering, let's change landscape instead of portrait mode, etc.

If you are with my thinking so far, the idea is to NOT to make a Winword doc "from scratch" using Perl to control Word. Make a template and macros that you need within Word so that you can with just a few key strokes make a fancy looking report from the text input. THEN use Perl to automate those very few commands that you can do easily by hand - it may come down to just opening Word and running a single macro. Avoid all of this detailed WinWord Visual Basic stuff to the maximum extent possible.

Anyway, that is what my thinking would be as a first approach to a fancy document. But it doesn't sound like you need a "fancy document". WinWord can open a plain text or RTF file and import if the user just clicks that it is "ok" to do that.


In reply to Re^3: Help generating MS Word .doc file from perl by Marshall
in thread Help generating MS Word .doc file from perl by schick79

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.