Skip to main content
OCLC Support

PrintLabel

Find the syntax, use, parameters, return values, and an example for the PrintLabel macro command in Connexion client.
Syntax BOOL = CS.PrintLabel (sHoldingCode, nCopies, sConstant1, sNumbers1, sConstant2, sNumbers2)
Use to Print the label from the current record or from records selected in a list, based on field data in the record(s).
Or
If you have the Label Printing option selected under Perform local actions in batch (in Tools > Options > Batch):
  • Marks the record ready (R) for batch label printing (if record is in the local save file).
    Or
  • Saves the record to the local save file and then marks it ready for batch (if record is in the online save file).
Same as using the menu command File > Print Label(s).
Parameters
  • For sHoldingCode, enter the holding library code used to print the label, enclosed in quotation marks (determines the input stamps for the label).
  • For nCopies, enter the number of copies of the label to print (1 to 999). Default: 1 copy.
  • For sConstant1, enter text to print on the label to identify multiple copies or parts, enclosed in quotation marks. Use letters, numbers, and punctuation marks.
  • For sNumbers1, enter numbers to appear on the label with print constant 1, enclosed in quotation marks. Use only numbers, commas, hyphens, and quotation marks.
  • For sConstant2, enter additional text to print on the label, enclosed in quotation marks. Use letters, numbers, and punctuation marks.
  • For sNumbers2, enter numbers to appear on the label with print constant 2, enclosed in quotation marks. Use only numbers, commas, hyphens, and quotation marks.
Comments
  • You must start the label printing process with StartLabelBatch and end the process with EndLabelBatch when you use the PrintLabel command.
  • Field data in the record(s) that impacts on content of the label(s) must be correct before you use this command.
  • Printing setup options in Tools > Options > Printing apply.
  • Uses your default printer in Windows or the label printer you select in Tools > Options >Printing.

    See Print labels for more information about how the client produces labels.
  • The client automatically saves the record when you use this macro command.
Return values TRUE if the action is successful, or FALSE if not.
Example Sub Main()

     Dim CS As Object
     Set CS = GetObject(,“Connex.Client”)

     If CS.IsOnline = False Then
          CS.Logon ““, ““, ““
     End If

     CS.Search “WC”, “gon,wi,th,w”

     batchStarted = CS.StartLabelBatch
     If batchStarted = True Then
          CS.PrintLabel “ZMYA”, 2, “v.”, “1,2,3”, “c.”, “1,2”
          CS.EndLabelBatch
     End If

End Sub

What this example does
  • Logs on to Connexion if not already logged on, using the default authorization and password you selected in Tools > Options > Authorizations tab.
  • Searches WorldCat for Gone with the Wind using a derived title search.
  • Starts a label batch print and prints two copies of labels based on field data for record number 1 for holding library code ZMYA with the following print constants:
    • v.1 c.1
    • v.1 c.2
    • v.2 c.1
    • v.2 c.2
    • v.3 c.1
    • v.3 c.2