![]() |
|
We don't bite newbies here... much | |
PerlMonks |
Re: VBA to Perlby marto (Cardinal) |
on Feb 10, 2006 at 12:01 UTC ( #529333=note: print w/replies, xml ) | Need Help?? |
Hi sanPerl,
The code $Word->Selection->Text="This is the inserted text" Looks wrong to me, do you want to select or type text? If you want to type text I think it should be in the form of TypeText("your text goes here").
You should check out the Win32::OLE documentation, under Hints for Microsoft Office automation it reads: 'The object model for the Office applications is defined in the Visual Basic reference guides for the various applications. These are typically not installed by default during the standard installation.' If you are unsure of the object model surf over to http://msdn.microsoft.com and have a look around. ActiveState have an article How to convert a VBA macro to Perl which should be worth a read. Update:I just tested the VB macro in Word 2003 against the code I posted above. To me it looks like the document produced by the VB code is the same as the document produced by the Perl code. Hope this helps. Martin
In Section
Seekers of Perl Wisdom
|
|