From: Gary Stainburn <[EMAIL PROTECTED]>
> On Tuesday 02 November 2004 12:28 pm, Rok Jaklic wrote:
> > Hi.
> >
> > Is there any way to create Microsoft Word Document (.doc) with Perl;
> > without installed Microsoft Word and Win32::OLE?
> >
> > Best regards,
> >
> > Rok
>
> Hi Rok.
> 
> Not a direct answer to your question, but.....
> 
> Does it need to be a .doc?
> 
> When I had to create documents I found it easier to create a .rtf file
> instead.  RTF supports most of the formatting features you're likely
> to require and and much more portable.

I agree RTF is good enough. And you can even give it .doc extension and the users will 
not see any difference.
 
> There are a number of modules on CPAN for creating RTF files, but I
> didn't even need those.  I simply created the blank letter in
> OpenOffice putting placeholders where I wanted to insert text and then
> simply used that as a template for my perl prog - I was using it to
> extract data from our company management system written in COBOL to
> create pre-mailmerged documents (having a mailmerge/datasource and
> using Word to do the mailmerge took too long!!!)

This is fine only as long as
        1) the editor doesn't put any RTF codes inside the placeholders
        2) you do not need loops or conditionals in the template or the 
repeated/optional part contains as many opening as closing curlies.

The curlies are actually rather annoying once you start using 
loops/conditionals. So you might want to try a module instead. Eg. 
http://jenda.krynicky.cz/#Template::RTF

Jenda
===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
        -- Terry Pratchett in Sourcery


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to