ShadowElf Posted March 8, 2010 Posted March 8, 2010 I have read entire forum about print preview in IE. there is no way to open print preview??!! I want to add a button to start print preview Func debl() Global $Formdebloc if $Formdebloc Then GUIDelete($Formdebloc) EndIf Local $IE, $GUIActiveX $IE = ObjCreate("Shell.Explorer.2") $Formdebloc = GUICreate("Deblocare pos", 364, 403, 208, 136) $GUIActiveX = GUICtrlCreateObj( $IE, 24, 24, 321, 273) GUICtrlSetData(-1, "Edit1") GUICtrlCreateButton("Inchide", 88, 336, 177, 41) GUICtrlSetOnEvent(-1, "outdebloc") $IE.navigate("http://localhost/pos/debloc.php") Do Sleep(100) Until NOT $IE.Busy $IE.refresh $IE=0 ;~ _IEAction($IE, "print") GUISetState(@SW_SHOW) sleep(1000) ControlSend($IE, "", "", "!f"); don't work ControlSend($IE, "", "", "v"); don't work ;~ $IE.execWB('7',2) ;don't work _IEAction($IE, "print")don't work EndFunc I like IT: php, mysql, codeingiter, css, jquery and AUTOIT
PsaltyDS Posted March 8, 2010 Posted March 8, 2010 Don't target the document or application objects with your ControlSend(), that has to target the IE window: $hIE = _IEPropertyGet($IE, "hwnd") ControlSend($hIE, "", "", "!f") ControlSend($hIE, "", "", "v") Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
ShadowElf Posted March 8, 2010 Author Posted March 8, 2010 IE.au3 V2.4-0 Error from function _IEPropertyGet, $_IEStatus_InvalidDataType I like IT: php, mysql, codeingiter, css, jquery and AUTOIT
PsaltyDS Posted March 8, 2010 Posted March 8, 2010 (edited) This works fine: #include <IE.au3> $oIE = _IECreate("http://www.autoitscript.com") $hIE = _IEPropertyGet($oIE, "hwnd") ControlSend($hIE, "", "", "!f") ; Alt-f Sleep(100) ControlSend($hIE, "", "", "v") ; v (Print Preview) An ActiveX instance of IE doesn't have all the toolbar functions available, including print preview. Edited March 8, 2010 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
PsaltyDS Posted March 8, 2010 Posted March 8, 2010 (edited) Ah, found the execWB for it: #include <GuiConstantsEx.au3> #include <IE.au3> $oIE = _IECreateEmbedded() $hGUI = GUICreate("Test", 600, 600) $idObj = GUICtrlCreateObj($oIE, 10, 10, 580, 530) $idButton = GUICtrlCreateButton("PrintPreview", 250, 550, 100, 30) _IENavigate($oIE, "http://www.autoitscript.com") GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $idButton $oIE.execWB(7, 2) EndSwitch WEndFor reference: execWB methodOLECMDID valuesOLECMDEXECOPT values Edited March 8, 2010 by PsaltyDS Parsix 1 Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
ShadowElf Posted March 9, 2010 Author Posted March 9, 2010 Thx PsaltyDS I like IT: php, mysql, codeingiter, css, jquery and AUTOIT
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