Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How can I have IE print from VFP
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00922610
Message ID:
00922665
Vues:
28
Ok!
But the Print dialog is popup! Plus like this the plugin is not show in the page.

I need to print direcly with out showing the print dialog.

>Hi. I'm not sure whether you want to do it this way or whether the Autodesk plug-in will cause any issues vs. how this works with a standard html file, but does this work for you?
>
>
>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 )
>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform