Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Creating Word Documents with Perl

Reply
Thread Tools

Creating Word Documents with Perl

 
 
amerar@iwc.net
Guest
Posts: n/a
 
      04-06-2007

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

 
Reply With Quote
 
 
 
 
amerar@iwc.net
Guest
Posts: n/a
 
      04-06-2007
On Apr 6, 10:32 am, Michele Dondi <(E-Mail Removed)> wrote:
> On 6 Apr 2007 07:49:51 -0700, "(E-Mail Removed)" <(E-Mail Removed)> wrote:
>
> >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???


 
Reply With Quote
 
 
 
 
Scott Bryce
Guest
Posts: n/a
 
      04-06-2007
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:

> 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.
 
Reply With Quote
 
Brian Wakem
Guest
Posts: n/a
 
      04-06-2007
(E-Mail Removed) wrote:

> On Apr 6, 10:32 am, Michele Dondi <(E-Mail Removed)> wrote:
>> On 6 Apr 2007 07:49:51 -0700, "(E-Mail Removed)" <(E-Mail Removed)> wrote:
>>
>> >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.

--
Brian Wakem
Email: http://homepage.ntlworld.com/b.wakem/myemail.png
 
Reply With Quote
 
Amer Neely
Guest
Posts: n/a
 
      04-07-2007
(E-Mail Removed) wrote:
> On Apr 6, 10:32 am, Michele Dondi <(E-Mail Removed)> wrote:
>> On 6 Apr 2007 07:49:51 -0700, "(E-Mail Removed)" <(E-Mail Removed)> wrote:
>>
>>> 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.

--
Amer Neely
w: www.softouch.on.ca/
Perl | MySQL programming for all data entry forms.
"We make web sites work!"
 
Reply With Quote
 
Mumia W.
Guest
Posts: n/a
 
      04-07-2007
On 04/06/2007 11:21 AM, (E-Mail Removed) wrote:
>
> 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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating Word Documents Brian Cryer ASP .Net 3 02-01-2007 04:55 PM
ASP Creating word documents(content-disposition) Tom ASP General 2 02-23-2006 10:02 PM
Creating Word documents on page enak ASP .Net 11 11-05-2003 06:43 AM
Editing Word documents in Perl (Openoffice Writer or MS Word) Tony Perl Misc 2 09-01-2003 09:48 PM
convert word documents using Perl Zak Chababe Perl 0 07-12-2003 02:11 AM



Advertisments