How To Print Labels In Colors By Vba Programming ?
I’m using this VBA code (ACCESS) to print labels.
But although the printer is a color printer set to “color”, the printed label is only black & white. The same printer with the same parameters give a color label, when used directly with Bartender 9.3.
As somebody an idee ?
Thanks
Michel
Public Function imprimer(nbcopies, refsurg, Lot, ModeleBt, Imprimante)
Dim MyApp As BarTender.Application
Dim MyDoc As New BarTender.Format
Dim MyVars As BarTender.SubString
Dim Str1, Str2 As String
Set MyApp = CreateObject("BarTender.Application")
MyApp.Visible = False
Str1 = ModeleBt
Str2 = Imprimante
Set MyDoc = MyApp.Formats.Open(Str1, False, Str2)
MyDoc.SetNamedSubStringValue "NumLot", Lot
MyDoc.Databases.QueryPrompts.GetQueryPrompt("Invite1").Value = refsurg
MyDoc.IdenticalCopiesOfLabel = nbcopies
MyDoc.PrintOut
MyApp.Quit (BarTender.BtSaveOptions.btDoNotSaveChanges)
Set MyDoc = Nothing
Set MyApp = Nothing
End Function
But although the printer is a color printer set to “color”, the printed label is only black & white. The same printer with the same parameters give a color label, when used directly with Bartender 9.3.
As somebody an idee ?
Thanks
Michel
Public Function imprimer(nbcopies, refsurg, Lot, ModeleBt, Imprimante)
Dim MyApp As BarTender.Application
Dim MyDoc As New BarTender.Format
Dim MyVars As BarTender.SubString
Dim Str1, Str2 As String
Set MyApp = CreateObject("BarTender.Application")
MyApp.Visible = False
Str1 = ModeleBt
Str2 = Imprimante
Set MyDoc = MyApp.Formats.Open(Str1, False, Str2)
MyDoc.SetNamedSubStringValue "NumLot", Lot
MyDoc.Databases.QueryPrompts.GetQueryPrompt("Invite1").Value = refsurg
MyDoc.IdenticalCopiesOfLabel = nbcopies
MyDoc.PrintOut
MyApp.Quit (BarTender.BtSaveOptions.btDoNotSaveChanges)
Set MyDoc = Nothing
Set MyApp = Nothing
End Function
0
-
I assume the document design itself has some colour elements in it?
Assuming yes to the above question, make sure that you set the printer driver settings via the BarTender "Print" dialog and "Document Properties" button so that the label will indeed print in colour. After making those settings save the label document to make sure those settings are saved and embedded in the BarTender file and are thus used when opened in any kind of context.0 -
Thank you very much,
Your suggestion solve my problem.
Michel0
Please sign in to leave a comment.
Comments
2 comments