Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Win32::OLE and taint

by Generoso (Prior)
on Dec 01, 2013 at 20:37 UTC ( #1065181=note: print w/replies, xml ) Need Help??


in reply to Win32::OLE and taint

This works for me. Try it.

use Win32::OLE qw(in with); use Win32::OLE::Const 'Microsoft Word'; $Win32::OLE::Warn = 2; # Throw Errors, I'll catch them my $Word = Win32::OLE->GetActiveObject('Word.Application') || Win32::OLE->new('Word.Application', 'Quit'); $Word->{'Visible'} = 1; $Word->Documents->Add || die("Unable to create document ", Win32::OLE- +>LastError()); my $MyRange = $Word->ActiveDocument->Content; my $mytxt = "Some Random Text"; # I'll fill this in later # add a table that is the header portion, 1 column by 1 row $Word->ActiveDocument->Tables->Add({ Range => $MyRange, NumRows => 1, NumColumns => 1, }); $Word->Selection->TypeText ({ Text => $mytxt}); $Word->Selection->MoveRight({Count => 1}); $Word->Selection->TypeText ({ Text => "A little more text"});

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1065181]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2020-05-31 07:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (173 votes). Check out past polls.

    Notices?