Hello

Some days ago I wrote a mail asking for a way to pass a web page to word
document. Thanks to Brian's help I could do this code, but I have a matter
when I decide put the cgi to work from my server... It works right when I
run it in Perl Builder but it's not so when I do it from the web server.

It doesn't send me any error message....... and only can get the htm file
in Documentos directory.

Do you have any idea what is happening ?
 
Thanks again
 
###################################################################
 
use Win32::OLE;
use Win32::OLE qw(in with);
use Win32::OLE::Const ('Microsoft Word') ;

use IO::File ;

use LWP::UserAgent ;

use CGI ; 

$Output = new CGI ;

$ua = new LWP::UserAgent ;

$Output->header();

############################################################################
#######

print $Output->header(-type=>'text/html',-expires=>'now'); 
print $Output->start_html(-title=>'SAVING WORD DOCUMENTS',
                          -base=>'true',
                          -target=>'_parent',
                          -BGCOLOR=>'#FFD9B3'); 
                                                   
############################################################################
#######
my $filename="c:\\Documentos\\htmprueba.htm";

my $req= new HTTP::Request
'GET','http://150.186.76.5/Paginas/Pruebas/htmprueba.htm' ;

$res = $ua->request($req,$filename) ;                           

if($res->is_success) {
        print qq!<p> ok</p>!;
}

&todoc($filename);

sub todoc {
# Get the filename argument...
my $file_in=shift;

my $file_out="c:\\Documentos\\htmprueba" ;

$word = Win32::OLE->new('Word.Application', 'Quit')or die "Can't create
Word object\n";

    $doc = $word->Documents->Open({
     FileName  => $file_in,
     ConfirmConversions => 0,
     ReadOnly  => 1,
     AddToRecentFiles => 0,
     Format   => wdOpenFormatAuto});

    $rc = $doc->SaveAs({
     FileName  => $file_out,
     FileFormat  => wdFormatDocument});
    $rc = $doc->Close;
}

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users

Reply via email to