Control an external program

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • nielsh

    #1

    Control an external program

    Hello all of you.

    I have a little big problem.
    I have made a little program that starts an external program (Acrobat).
    When the program has loaded i use the sendkeys method to make the
    actions i want to do.
    When i test my application, it works fine, but when I try it on a
    different computer where Acrobat also installed, the program works ,
    but gives no output...

    The version and language of Acrobat asre the same on both machines, the
    only difference is the operating system (mine is WinXP, the other is
    Win2000)

    Can anyone tell me if my problem could be the operating system, or
    something else.

    Maybe someone knows a better solution for what I am trying to do here,
    please give it to me...

    ###Code###
    Dim ProcID As Integer
    ' Start the Application application, and store the process
    id.
    ProcID = Shell("C:\Progr am Files\Adobe\Acr obat
    7.0\Acrobat\Acr obat.exe", AppWinStyle.Nor malFocus)
    ' Activate the application.
    AppActivate(Pro cID)
    'Open the given file
    SendKeys.SendWa it("^o") 'Open a file
    SendKeys.SendWa it(edtFile.Text )
    SendKeys.SendWa it("~") 'Enter

    'Here stands more code before I save the file. but it was irrelevant
    code so I left it away

    'Saving
    SendKeys.SendWa it("^s") 'Save as
    SendKeys.SendWa it(edtFile.Text & "Booklet.pd f")
    SendKeys.SendWa it("~") 'Enter
    SendKeys.SendWa it("%{F4}") 'Close Application
    ###Code###


    Thanks in advance

Working...