relax99 has asked for the wisdom of the Perl Monks concerning the following question:
I have the following problem at hand. I need to fill out a word document with values from a web form. It seems to me that the most natural way to automatically modify a word document is to use Win32::OLE module. However, I do not know how to be able to control this process from a web based interface. I wrote a CGI script that attempts to create a COM object that represents a Microsoft Word application. When I run the script it never finishes. Using the trial and error method I determined that the execution stops when I try to open a word document after the COM object has been created. Below is the sample of the code I use. The web server is IIS5 on Windows 2000. I use Perl version 5.8
# initialize Word object my $Word = Win32::OLE->GetActiveObject("Word.Application", \&QuitApp); if( !$Word ) { $Word = Win32::OLE->new("Word.Application", \&QuitApp) or die "coul +dn't create an OLE object"; } $Word->Documents()->Open("c:\\Projects\\wtemplates\\TEMPLATE.DOC"); ...
Does anyone have any experience working with Win32::OLE? What is it that is going wrong with my script? Also, maybe I am not approaching the problem the right way. Is what I'm trying to do feasible? Are there any other ways of doing this? Like, maybe, creating a Windows service to process word documents that runs continuously and communicates with my script via a named pipe?
I would appreciate any thoughts on this.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: OLE from CGI - Is it possible?
by JamesNC (Chaplain) on Jan 29, 2003 at 19:04 UTC | |
|
Re: OLE from CGI - Is it possible?
by Jenda (Abbot) on Jan 29, 2003 at 19:12 UTC | |
|
Re: OLE from CGI - Is it possible?
by chromatic (Archbishop) on Jan 29, 2003 at 19:02 UTC | |
|
Re: OLE from CGI - Is it possible?
by dragonchild (Archbishop) on Jan 29, 2003 at 18:26 UTC | |
by relax99 (Monk) on Jan 29, 2003 at 18:39 UTC | |
|
Re: OLE from CGI - Is it possible?
by relax99 (Monk) on Jan 29, 2003 at 20:11 UTC | |
|
Re: OLE from CGI - Is it possible?
by grantm (Parson) on Jan 30, 2003 at 08:42 UTC | |
by relax99 (Monk) on Feb 10, 2003 at 21:35 UTC | |
by grantm (Parson) on Feb 10, 2003 at 22:03 UTC | |
by relax99 (Monk) on Jan 30, 2003 at 18:16 UTC |