Home: Perl Programming Help: Advanced:
perl automation of word


Jan 13, 2000, 2:57 AM

Views: 5579
perl automation of word

Hi, I am trying to use perl to access the
exposed objects of word 97.So far I can only
open the word application.
Is there anywhere I could get a few examples
of word automation using perl.


Administrator / Moderator

Jan 13, 2000, 5:27 AM

Views: 5579
Re: perl automation of word


Try as I might, I could not find many examples of Word Automation using Perl. Now I probably sound like a broken record (if you've seen my previous posts), but I don't know Perl for Win32. However, I like to research Smile The info below is what I came up with... hopefully, you'll find at least some of this useful.

If you don't already have a fair understanding of Visual Basic, you probably should go that way first so you can code as much of your automation in VB, then call the VB code from your Perl program.

I've checked my "Automating Office with Perl" book, and the Word examples are limited to running a macro, printing pages, and adding text to a page. It did not get into the nuts and bolts of much -- a fair overview, though.

While the information about Word is sparse, to say the least, I found a pretty good example of a Perl program for Excel at Microsoft's site

To access exposed objects, you'll need to dig into the Word's Object Model.

Check out the Microsoft Developer Network Online Library. There, you can select your version of Office (after you select Office Developer Documentation), and review the Object Model Guide. The VB reference is also there.

The direct link to Word 2000's Object Model (visual layout) guide is here. Reference information for this object model should also (already) be on your hard drive at \Program Files\Microsoft Office\Office\VBAWRD9.CHM.

Here's some other references (note: these pages don't even mention Perl, but they offer lots of VB info that may help your automation goals):

Find and Use Office Object Model Documentation

How to Use (OLE) Automation with Word

I hope you find some of this useful... good luck!

[This message has been edited by Jasmine (edited 01-13-2000).]