VB6 + bartender (Software d'étiquette)

drossion Messages postés 2 Date d'inscription mercredi 7 septembre 2005 Statut Membre Dernière intervention 31 janvier 2011 - 31 janv. 2011 à 09:03
julienexam Messages postés 21 Date d'inscription mardi 3 avril 2012 Statut Membre Dernière intervention 12 avril 2012 - 4 avril 2012 à 14:27
Bonjour,

J'utilise Bartender 7.1 a travers VB6
Cela fonctionne très bien voir exemple ci-dessous

Dim btApp As New BarTender.Application
Dim btFormat As New BarTender.Format
Dim btPrintSetup As New BarTender.PrintSetup
Set btApp = CreateObject("BarTender.Application")
Set btFormat = btApp.Formats.Open(ReportsPath & "\PRODUCTLABELSILAGE.btw", False, "")
Set btPrintSetup = btFormat.PrintSetup
btFormat.SetNamedSubStringValue "COD", IIf(IsNull(rs!COD), " ", rs!COD)
btFormat.SetNamedSubStringValue "Item", IIf(IsNull(Trim(xmart1)), "", Trim(xmart1))
btFormat.SetNamedSubStringValue "Item1", IIf(IsNull(Trim(xmart2)), "", Trim(xmart2))
btFormat.SetNamedSubStringValue "Length", IIf(IsNull(rs2!GBB5), " ", rs2!GBB5)
btFormat.SetNamedSubStringValue "Tmax", IIf(IsNull(rs2!pro), " ", rs2!pro)
btFormat.SetNamedSubStringValue "Tmin", IIf(IsNull(rs2!ph2), " ", rs2!ph2)
btFormat.SetNamedSubStringValue "Width", IIf(IsNull(rs2!GBB3), " ", rs2!GBB3)
btFormat.SetNamedSubStringValue "Stockage", IIf(IsNull(rs2!mar), " ", rs2!mar)
btFormat.SetNamedSubStringValue "SSCC", IIf(IsNull(sscc), " ", sscc)
btFormat.SetNamedSubStringValue "SSCC1", IIf(IsNull(sscc1), " ", sscc1)
btFormat.SetNamedSubStringValue "Cling", IIf(IsNull(rs2!clg), " ", rs2!clg)
btFormat.SetNamedSubStringValue "GTIN", IIf(IsNull(rs2!ean), " ", "0" & Left(rs2!ean, 12))
btPrintSetup.IdenticalCopiesOfLabel = rs2!pbr
btPrintSetup.Printer = Port ("name of the server/name of the printer")
btFormat.PrintOut False, False
btApp.Quit
J'aimerai en plus de selectionner l'imprimante pouvoir sélectionner le bac sur lequel je veux imprimer (Mon imprimante possède 4 bacs) et je voudrait en dédier un pour l'application BARTENDER.
J'ai cherché dans la doc mais il ne parle pas de gestion des bacs.
Quelqu'un pourrait-il m'aider
D'avance MERCI.

1 réponse

julienexam Messages postés 21 Date d'inscription mardi 3 avril 2012 Statut Membre Dernière intervention 12 avril 2012
4 avril 2012 à 14:27
Bonjour,

j'utilise un programme sensé faire fonctionner VB6 et bartender ensemble, mais les trois premières lignes :

Dim btApp As New BarTender.Application
Dim btFormat As New BarTender.Format
Dim btPrintSetup As New BarTender.PrintSetup

entrainent une erreur : "Erreur de compilation : type défini par l'utilisateur non défini"

peux tu m'expliquer comment tu les as définis?

cordialement


julienexam
0
Rejoignez-nous