Thanks
I am able to print now but I have a different situation, i need to print in landscape orientation instead of portrait
I am printing in text and I believe Notepad is the program that opens the reports by default
here is a sample of the code I am using and works fine
Module:
Public Declare Function apiShellExecute 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
Command:
Private Sub cmdPrint_Click()
Dim strFileAndPath As String
Dim lngReturn As String
strFileAndPath = "C:\Data\P139-C150-802-07-31-08.txt"
lngReturn = apiShellExecute(hWndAccessApp, "print", _
strFileAndPath, vbNullString, vbNullString, 0)
End Sub
As I explained above, this code works and i am printing my reports but the orientation needs to be changed to landscape
I found this code but not sure where to put itPrinter.orientation = acPRORLandscape
Thank you