#DEFINE OLECMDID_PRINT 6 #DEFINE OLECMDEXECOPT_PROMPTUSER 1 #DEFINE LECMDEXECOPT_DONTPROMPTUSER 2 #DEFINE OLECMDF_SUPPORTED 1 &&Command is supported by this object. #DEFINE OLECMDF_ENABLED 2 &&Command is available and enabled. oBrowser=CREATEOBJECT("internetexplorer.application") oBrowser.Navigate2('www.levelextreme.com') DO WHILE oBrowser.QueryStatusWB(OLECMDID_PRINT) != (OLECMDF_SUPPORTED + OLECMDF_ENABLED) DOEVENTS ENDDO oBrowser.ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_PROMPTUSER)>This is what I am looking for.
>ox=CREATEOBJECT('InternetExplorer.Application') >ox.navigate("C:\pdftest\InterVAC.htm") >* then someting like >ox.print() && which do not work >>
>>TEXT TO xx >><html> >>Testing<br>1<br>2<br>3<br> >></html> >>ENDTEXT >>STRTOFILE( m.xx, "junk.html" ) >>nResult = api_shellexecute( "junk.html", CURDIR(), "PRINT" ) >> >>* Note - this is a proc that's been in my lib a few years and I think I lifted the code or at least the idea from the UT. >>PROCEDURE API_ShellExecute >>* WinApi :: ShellExecute >>** Function: Opens a file in the application that it's >>** associated with. >>** Pass: lcFileName - Name of the file to open >>** >>** Return: 2 - Bad Association (e.g., invalid URL) >>** 31 - No application association >>** 29 - Failure to load application >>** 30 - Application is busy >>** >>** Values over 32 indicate success >>** and return an instance handle for >>** the application started (e.g., the browser) >>LPARAMETERS tcFileName,tcWorkDir,tcOperation >>LOCAL lcFileName,lcWorkDir,lcOperation >> >>IF EMPTY ( tcFileName ) OR VARTYPE ( tcFileName ) <> "C" >> RETURN -1 >>ENDIF >> >>lcFileName = ALLTRIM ( tcFileName ) >>lcWorkDir = IIF ( VARTYPE ( tcWorkDir ) = "C", ALLTRIM ( tcWorkDir ), "" ) >>lcOperation = IIF ( VARTYPE ( tcOperation )= "C" AND NOT EMPTY ( tcOperation ), ; >> ALLTRIM ( tcOperation ), "Open" ) >> >>*-* HINSTANCE ShellExecute(hwnd, lpszOp, lpszFile, lpszParams, lpszDir, wShowCmd) >>*-* >>*-* HWND hwnd - handle of parent window >>*-* LPCTSTR lpszOp - address of string for operation to perform >>*-* LPCTSTR lpszFile - address of string for filename >>*-* LPTSTR lpszParams - address of string for executable-file parameters >>*-* LPCTSTR lpszDir - address of string for default directory >>*-* INT wShowCmd - whether file is shown when opened >>DECLARE INTEGER ShellExecute IN SHELL32.DLL ; >> INTEGER nWinHandle,; >> STRING cOperation,; >> STRING cFileName,; >> STRING cParameters,; >> STRING cDirectory,; >> INTEGER nShowWindow >> >>RETURN ShellExecute ( 0, lcOperation, lcFilename, "", lcWorkDir, 1 ) >>