Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do i send directly to the print

Status
Not open for further replies.

miha75

Programmer
Sep 9, 2003
4
RO
how do i send directly to the printer a txt file, from microsoft access
 
One way is to use the ShellExecute function...

'Put this declaration at the top of the module where you want to print

Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

'You can then call it from anywhere in the module with

ShellExecute 0&, "print", "C:\Test\Test.txt", vbNullString, vbNullString, vbMinimizedFocus

'You can send the filename as a string variable if you wish

Hope this helps...



There are two ways to write error-free programs; only the third one works.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top