Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Monks, i am using below vb coding for acrobat manipulation. I want to convert this into to perl, so that it will be useful for me to add in the plugin. Is it possible to do so. I tried using Win32::OLE module, but i am not having much exposure in that module, i have done only simple macro running and addition in that module. So could anyone help me?

Private Sub Form1_GotFocus(ByVal sender As Object, ByVal e As System.E +ventArgs) Handles MyBase.GotFocus AppActivate("Adobe Acrobat Professional") SendKeys.Send("%Cf") SendKeys.Send("{ENTER}") SendKeys.Send("{TAB}") SendKeys.SendWait("{ENTER}") Dim a As String a = MsgBox("Process is Completed?", , "Adobe Acrobat") End End Sub

Replies are listed 'Best First'.
Re: Convert VB equivalent to perl
by marto (Cardinal) on Dec 30, 2005 at 12:16 UTC
    Anonymous Monk,

    You say you tried using Win32::OLE but you have not posted your code or explained what problems you are having. You also tell us that you don't have much exposure to the module, have you looked at the module documentation?
    Also check out the Tutorials section of this site for some Win32::OLE examples.

    You may find the module Win32::GuiTest helpful, you could use it to drive the Acrobat application via SendKeys etc.
    If you read the module documentation I dont think it will take you too long to convert your VB to Perl using Win32::GuiTest.

    Hope this helps.

    Martin
Re: Convert VB equivalent to perl
by holli (Abbot) on Dec 30, 2005 at 12:25 UTC
    What exactly are you trying to accomplish? There are a bunch of PDF modules for perl, so chances are good you don't need Acrobat at all.


    holli, /regexed monk/
Re: Convert VB equivalent to perl
by davidrw (Prior) on Dec 30, 2005 at 18:02 UTC
Re: Convert VB equivalent to perl
by ikegami (Patriarch) on Dec 31, 2005 at 02:04 UTC

    Problem #1: SendKeys is not an OLE class. Win32::OLE won't help here.

    Problem #2: AppActivate is not an OLE class. It's not even a class. Win32::OLE won't help here.

    You'll have to start by finding an equivalent library in Perl (Win32::GuiTest was mentioned), or by finding out how they work at the system call level (in order to use XS or Win32::API.