There's a chapter on OLE and COM in Dave Roth first Win32 Perl Programming
book  "The standard Extensions" (chapter 5 : Automation) 
Look at http://www.roth.net/

About OLE also have a look at : 
http://aspn.activestate.com/ASPN/Reference/Products/ActivePerl/faq/Windows/A
ctivePerl-Winfaq12.html

and search google for OLE AUTOMATION PERL keywords


Here are some snipets of code you can give a try to.  
Make sure you install the relevant modules first : 

#+++++++++++++++++++++++++++++++++++++++
use OLE;
$application = CreateObject OLE 'Word.Application' || die $!;

$application->{'Visible'} = 1;
$doc = $application->Documents->Add();
$s = $application->Windows(1)->Selection;
$s->{Text} = 'Hello, world!' ;




#+++++++++++++++++++++++++++++++++++++++
use WIN32::OLE;

eval {$application = Win32::OLE->GetActiveObject('Word.Application')};
   die "Microsoft Word not found !" if $@;
   unless (defined $application) {
        $application = Win32::OLE->new('Word.Application', sub
{$_[0]->Quit;})
      or die "Oops, cannot start Word";
        }

$application->{'Visible'} = 1;
$doc = $application->Documents->Add();
$s = $application->Windows(1)->Selection;
$s->{Text} = 'Hello, world!' ;
$application->Selection->Font->{'Bold'}="1";
$application->Selection->Font->{'Size'}="14";


_____________________________________________
Bruno Bellenger
Sr. Network/Systems Administrator 


        -----Original Message-----
        From:   Mark Bergeron [SMTP:[EMAIL PROTECTED]]
        Sent:   Tuesday, April 23, 2002 2:23 PM
        To:     [EMAIL PROTECTED]
        Subject:        Opening and writing to Word.docs

        Hello group,
        Could someone give me a link or two on the topic of opening and
writing to Word 2000, 2002 files? Modules, example sites, guidlines... I
know there is probably something on perl.com but, I had hoped one of you
guys had recently done something like this.

        TVMIA,Mark Bergeron

        ___________________________________________________
        GO.com Mail                                    
        Get Your Free, Private E-mail at http://mail.go.com


        _______________________________________________
        Perl-Win32-Web mailing list
        [EMAIL PROTECTED]
        To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to