topsecret Posted September 16, 2011 Share Posted September 16, 2011 $oAdobe = ObjCreate("AcroPDF.PDF") $oAdobe.LoadFile("C:\Face.pdf") -->Variable must be of type "Object" This is my FIRST script in which I am trying to use COM. I get the error I wrote above and can't understand why. I am veeeery convinced that it's a stupid, begginer problem but I did't find the answer anywhere else, please help! Link to comment Share on other sites More sharing options...
Richard Robertson Posted September 16, 2011 Share Posted September 16, 2011 It means that ObjCreate failed and you didn't bother to check to make sure that it actually returned an object. Link to comment Share on other sites More sharing options...
Ramzes Posted September 25, 2011 Share Posted September 25, 2011 (edited) You should use: $oAdobe = ObjCreate("AcroPDF.PDF.1"); Another way is using ShellExplorer. Little example: Global Const $Width = 800, $Height = 600 Global $Path = @ScriptDir & "\Your_file_name.pdf" $Form1 = GUICreate("Browse PDF", $Width, $Height, 400, 300) $Obj = ObjCreate("Shell.Explorer.2") $browser = GUICtrlCreateObj($Obj, 0, 0, $Width, $Height) GUISetState(@SW_SHOW) $Obj.Navigate($Path) While 1 $Msg = GUIGetMsg() Select Case $Msg = -3 ExitLoop EndSelect WEnd Edited September 25, 2011 by Ramzes Sorry for my bad English but nobody is perfect. [font=arial, helvetica, sans-serif]Ramzes[/font] Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now