Jeff Heilman
asked on
MS Access VBA Prevent file name dialogue when printing to a printer that prints to file.
Hello all,
I am developing an application that prints to a local printer that prints to a file, and then uses an LPR command to send that file directly to an IP barcode printer, an Intermec PC43d. The reasons that I went this route was because the file needs to include the IPL language so the printer knows what to do with the file, and the application needs to be able to print to one of maybe 15 printers that is closest to the user.
Everything is working, except when the report is printed by the barcode to file a dialogue pops up and asks for you to name the file. Obviously this won't work. What I need to do is prevent this dialogue and automatically name the file.
Here is the code for the print command:
Thanks in advance for any and all help or suggestions!
I am developing an application that prints to a local printer that prints to a file, and then uses an LPR command to send that file directly to an IP barcode printer, an Intermec PC43d. The reasons that I went this route was because the file needs to include the IPL language so the printer knows what to do with the file, and the application needs to be able to print to one of maybe 15 printers that is closest to the user.
Everything is working, except when the report is printed by the barcode to file a dialogue pops up and asks for you to name the file. Obviously this won't work. What I need to do is prevent this dialogue and automatically name the file.
Here is the code for the print command:
Private Sub cmdPrintTag_Click()
On Error Resume Next
Dim KillFile As String
KillFile = "C:\rptFrameTag"
If Len(Dir$(KillFile)) > 0 Then
SetAttr KillFile, vbNormal
Kill KillFile
End If
DoCmd.OpenReport "rptFrameTag", acViewPreview, , , acIcon
DoCmd.SelectObject acReport, "rptFrameTag", False
DoCmd.PrintOut , , , , 1
DoCmd.Close acReport, "rptFrameTag"
Dim str As String
Dim strIP As String
strIP = txtPrinterIP
str = "LPR -S " & strIP & " -P Print C:\rptFrameTag"
Shell str, 1
End Sub
Thanks in advance for any and all help or suggestions!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER