How to print in a BarTender-document via MS Access-code with given values?
All
I got next VBA-code in MS Access. The BarTender-document opens and the template is filled in.
Then I got a print dialog to select the printer and if I press print the "Form" appears with blank textboxes so I have to type in values manually. How can I solve this? I don't want the print dialog and the label must be printed out with the values I use with code below.
Private Sub cmdPrintDetector_Click()
Dim btApp As Object
Dim btFormat As Object
Set btApp = CreateObject("BarTender.Application")
btApp.Visible = True
Set btFormat = btApp.Formats.Open("c:\template\template.BTW"), False, "")
btFormat.SetNamedSubStringValue "model", Me.txtModel
btFormat.SetNamedSubStringValue "Date", Me.txtDate
btFormat.Printout False, False
btFormat.Close (btDoNotSaveChanges)
Set btFormat = Nothing
Set btApp = Nothing
End Sub
-
Peter Thane
★ BarTender Hero ★
Remove the fields/boxes from the Data Entry screen will get rid of the text boxes but it doesn't look like you are telling BarTender to print the label but just open it. Have you thought about using either a command line to control it or else use an Integration outputting the label format name (if variable), printer name (again if variable) and your data fields into a Text file which the integration looks for and then processes?
0 -
Kris Van Hoof
★ BarTender Hero ★
Thanks a lot, the issue is now solved.
0
Please sign in to leave a comment.
Comments
2 comments