

Here are some applications where you can put this method to use: Examples of real-life scenarios for file handling A macro can help you easily handle these files, and the Open method is your ticket.

PrintDocumentUsingShellExecute "Your Virtual Printer", "c:\Documents\AnyDocument.doc" For example, you can print MS Word and PDF documents this way: Then it’s necessary to call these functions with the required parameters. ' set the default printer back to original ShellExecute 0, "print", szDocumentPath, vbNullString, vbNullString, SW_HIDE SzDefaultPrinter = Left$(szNamePrinterBuff, InStr(szNamePrinterBuff, vbNullChar) - 1) GetDefaultPrinter szNamePrinterBuff, bufferSize Public Sub PrintDocumentUsingShellExecute(szPrinter As String, szDocumentPath As String)ĭim szDefaultPrinter, szNamePrinterBuff As String "SetDefaultPrinterA" (ByVal szPrinter As String) As Long Private Declare Function SetDefaultPrinter Lib "winspool.drv" Alias "GetDefaultPrinterA" (ByVal szPrinter As String, bufferSize As Long) As Long Private Declare Function GetDefaultPrinter Lib "winspool.drv" Alias It also demonstrates how to change the default system printer. The code sample below demonstrates how to print files programmatically on either a physical or a virtual printer using the ShellExecute function. How to print files programmatically using the ShellExecute function How to print files programmatically using the ShellExecute function– see below. Them in a zip archive to a remote machine using ftp or http protocols.ĭownload Collecting Multiple Documents: Virtual Printer for C#/C++, VB6/VB.NETģ. Collecting Multiple Documents – in this example we’ll create a more powerful client which will be able to collect files from multiple printed documents into collection and transfer This application demonstrates how to use an INI file to write print job information and paths to the generated files.ĭownload Sample Client Application: Virtual Printer for VB6Ģ.

Sample Client application used for testing and development purposes.

Home Download Pricing FAQ Manual Tutorials Known issues Newsġ.
