Zum Hauptinhalt gehen

Suche

Suche

Duplicate Labels Created By Bartender

Kommentare

1 Kommentar

  • Avatar
    Legacy Poster
      Public Sub PrintPCSLabel()
    
            Dim strBarcode As String = ""
    
            btFormat = btApp.Formats.Open(My.Settings.LabelPath, False, "")
    
    
            Try
                btFormat.SetNamedSubStringValue("Lotnumber", clsPrintPCS.PCSIDNo.ToUpper)
            Catch ex As Exception
            End Try
    
            Try
                btFormat.SetNamedSubStringValue("ItemNumber", clsPrintPCS.ItemNo.ToUpper)
            Catch ex As Exception
            End Try
    
            strBarcode = "ID" & clsPrintPCS.PCSIDNo.ToUpper & "(BB)" & clsPrintPCS.ItemNo.ToUpper
    
            Try
                btFormat.SetNamedSubStringValue("Barcode", strBarcode)
            Catch ex As Exception
            End Try
    
    
            '//set printer
            btFormat.Printer = My.Settings.Printer
    
    
            '//print section
            Dim intNoLabels As Integer = 0
            intNoLabels = clsPrintPCS.NoLabels
    
    
            If intNoLabels > 0 Then
    
                Try
                    btFormat.IdenticalCopiesOfLabel = intNoLabels
                    btFormat.PrintOut(False, False)
    
                    '//create a print log entry
                    UpdateLog(USER.ID, "Printed ItemNo - " + clsPrintPCS.ItemNo.ToUpper + _
                              " BatchNo - " + clsPrintPCS.PCSIDNo.ToUpper + _
                              "  " + ITEM.NoPCSLabels + " DHR Labels")
    
    
                Catch eCom As System.Runtime.InteropServices.COMException
                    btFormat.Close(BarTender.BtSaveOptions.btDoNotSaveChanges)
                    CreateLogFile("Error printing DHR Labels 1", eCom.Message, "PrintPCSLabel")
                    MsgBox(eCom.Message)
    
                Catch ex As Exception
                    btFormat.Close(BarTender.BtSaveOptions.btDoNotSaveChanges)
                    CreateLogFile("Error printing DHR Labels 2", ex.Message, "PrintPCSLabel")
                    MsgBox(ex.Message)
                End Try
    
            End If
    
    
            strBarcode = ""
    
    
            '//now close Bartender objects
            Try
                btFormat.Close(BarTender.BtSaveOptions.btDoNotSaveChanges)
    
            Catch ex As Exception
            Finally
    
                If Not (btFormat Is Nothing) Then
                    Marshal.FinalReleaseComObject(btFormat)
                End If
    
            End Try
    
        End Sub
    
    
    
    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.