Creating Word Documents with Perl

A

amerar

Hi All,

I need to create a Microsoft Word document on Perl. This will be on
a Linux Box.

The actual process is, I need the script to query a MySQL database and
get the data for the Word document, create the document, and email it.

The first and last steps are easy. I am lost on how to create the
Word document. And, as I mentioned, this is on a Linux box, not a
Windows box.....

Can anyone help???

Thanks!!

Art
 
A

amerar

I need to create a Microsoft Word document on Perl. This will be on
a Linux Box.
The actual process is, I need the script to query a MySQL database and
get the data for the Word document, create the document, and email it.
The first and last steps are easy. I am lost on how to create the
Word document. And, as I mentioned, this is on a Linux box, not a
Windows box.....

I believe that there are ways to do this, with Windows-specific
modules. Unfortunately this path won't work from Linux, unless by
means of some arcane trickery, but I doubt that. However is there any
compelling reason why the documents *must* be in M$ Word? Are they
meant to be edited? If not, you may consider e.g. nicely typeset
pdf's...

Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,

Basically what need is to prepare a nicely formatted document that
will be emailed. So, I'll need to create a document that will be an
email attachment, and, it needs to have different size fonts and
such. I can do this with an HTML document........

Perhaps that is the way to do it? Maybe create an HTML document, and
have them open it in IE or Firefox and print it???
 
S

Scott Bryce

Basically what need is to prepare a nicely formatted document that
will be emailed. So, I'll need to create a document that will be an
email attachment, and, it needs to have different size fonts and
such. I can do this with an HTML document........

I'd go with PDF. You can take your question over to comp.text.pdf and
see if they can give you some pointers.
Perhaps that is the way to do it? Maybe create an HTML document, and
have them open it in IE or Firefox and print it???

It depends on how important the page formatting is.
 
B

Brian Wakem

I need to create a Microsoft Word document on Perl. This will be on
a Linux Box.
The actual process is, I need the script to query a MySQL database and
get the data for the Word document, create the document, and email it.
The first and last steps are easy. I am lost on how to create the
Word document. And, as I mentioned, this is on a Linux box, not a
Windows box.....

I believe that there are ways to do this, with Windows-specific
modules. Unfortunately this path won't work from Linux, unless by
means of some arcane trickery, but I doubt that. However is there any
compelling reason why the documents *must* be in M$ Word? Are they
meant to be edited? If not, you may consider e.g. nicely typeset
pdf's...

Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,

Basically what need is to prepare a nicely formatted document that
will be emailed. So, I'll need to create a document that will be an
email attachment, and, it needs to have different size fonts and
such. I can do this with an HTML document........


If you rename somefile.html to somefile.doc, it will open in Word
automatically[1] and user wont even know it is HTML.


[1] assuming Word is installed and is the default for opening files with
the .doc extension.
 
A

Amer Neely

I need to create a Microsoft Word document on Perl. This will be on
a Linux Box.
The actual process is, I need the script to query a MySQL database and
get the data for the Word document, create the document, and email it.
The first and last steps are easy. I am lost on how to create the
Word document. And, as I mentioned, this is on a Linux box, not a
Windows box.....
I believe that there are ways to do this, with Windows-specific
modules. Unfortunately this path won't work from Linux, unless by
means of some arcane trickery, but I doubt that. However is there any
compelling reason why the documents *must* be in M$ Word? Are they
meant to be edited? If not, you may consider e.g. nicely typeset
pdf's...

Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,

Basically what need is to prepare a nicely formatted document that
will be emailed. So, I'll need to create a document that will be an
email attachment, and, it needs to have different size fonts and
such. I can do this with an HTML document........

Have you looked at the 'format' command in perl? I've done some pretty
nifty emails using it, and you don't need to attach anything - it's all
inline.
 
M

Mumia W.

Basically what need is to prepare a nicely formatted document that
will be emailed. So, I'll need to create a document that will be an
email attachment, and, it needs to have different size fonts and
such. I can do this with an HTML document........

Perhaps that is the way to do it? Maybe create an HTML document, and
have them open it in IE or Firefox and print it???

I believe that modern versions of MS Word are supposed to import HTML
documents easily, so that seems like the best option for you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top