Please I need someone help me, I want to know why it doesn't work in my web
server?...
It only works when I run it from Perl Builder.


Thanks in advance
____________________________________________________________________________
________



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 ;

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

print $Output->header(-type=>'text/html',-expires=>'now'); 
print $Output->start_html(-title=>'SAVING WORD DOCUMENTS',
                          -base=>'true',
                          -target=>'_parent',
                          -style=>{'src'=>'../../../Paginas/Estilos/estilo.css'},
                          -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.doc" ;

$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