Greetings all,
I'm wondering if anyone can post a sample script/snippet of working AutoIT code that opens a PDF into an AutoIT GUI? I have Acrobat professional installed and can use the object methods to drive most parts, but I have been simply unable to get the AVDoc.OpenInWindowEx method to work. I can use the DrawEx, but can't figure out what's wrong with actually opening a file in the window. The stripped-down test code I'm using (below) draws the GUI OK, but then crashes saying "The requested action with this method has failed." Then there's a bit of a line with AutoIT3.exe ended.rc:1. I get the same error whether the OpenInWindowEx attempt is before or after the @SW_Show.
I'm quite a newbie with all this, but have been searching to no avail here and on the SDK forums. Thanks, in advance, for any help anyone can provide.
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("WinTitleMatchMode", 2) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase
$sFile="C:\My Documents\AutoIt\Test\Test.pdf"
$oApp = ObjCreate("AcroExch.App")
$oAcrobat = ObjCreate("AcroExch.AVDoc")
$hGUI=GUICreate("TestApp", 1225, 900,0,0,$WS_CLIPCHILDREN)
$GUI_ActiveX = GUICtrlCreateObj($oApp, 10, 10, 800, 875)
GUISetState (@SW_SHOW)
sleep(2000)
$result = $oAcrobat.OpenInWindowEx($sFile,$GUI_ActiveX,"AV_DOC_VIEW",0,0,0,0,0,0,0)