Creating Microsoft Word Document with Perl

Creating Microsoft Word Document with Perl

am 02.11.2004 13:28:41 von Rok Jaklic

Hi.

Is there any way to create Microsoft Word Document (.doc) with Perl; without
installed Microsoft Word and Win32::OLE?

Best regards,

Rok


--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org

Re: Creating Microsoft Word Document with Perl

am 02.11.2004 13:49:25 von Gary Stainburn

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.

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!!!)

--
Gary Stainburn

This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2000


--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org

Re: Creating Microsoft Word Document with Perl

am 02.11.2004 14:39:47 von Jenda Krynicky

From: Gary Stainburn
> 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
===== Jenda@Krynicky.cz === 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: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org

Re: Creating Microsoft Word Document with Perl

am 03.11.2004 16:00:43 von Rok Jaklic

Thank you both for usefull information.





--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org