Support & Downloads

Example of Creating Template Files with Visual Basic Script

Create a Template File (Label Layout File)

  1. 1. Enter the following using a text editor and save it with a file name "Fixed asset.vbs".
                        
    'Create b-PAC object
    Set ObjDoc = CreateObject("bpac.Document")
            
    'Open template file created with P-touch Editor
    'Leave lbx file in the same folder as VBS file
    bRet = ObjDoc.Open(".¥Fixed asset.lbx"
            
    If (bRet <> False) Then 'normally open? 
           
            'Set "TN-9500" to text object of "Fixed asset name"
            ObjDoc.GetObject("Name").Text = "TN-9500"
                
            'Set "Information Systems Division" to
            'text object of "Management section"
            ObjDoc.GetObject("Section").Text = "Management section"
                
            'Set "1234567" to text object of "Identification No."
            ObjDoc.GetObject("Number").Text = "1234567"
                
            'Set "1234567" to bar code object
            ObjDoc.GetObject("QRCode1").Text = "1234567"
                
            'Execute printing
            ObjDoc.StartPrint "DocumentName", bpoAutoCut
            ObjDoc.PrintOut 1, bpoAutoCut
            ObjDoc.EndPrint
            ObjDoc.Close
    End If
            
    'Release b-PAC object
    Set ObjDoc = Nothing
                         
                    

    Notes

    • You can also change an image object and configure the font settings.
    • For methods available from b-PAC, refer to the b-PAC SDK documentation.

Executing the script

By executing "Fixed asset.vbs" with Explorer, a label is printed based on the values set in the script, using a label layout file created with P-touch Editor as a template.

Download

FAQ

For Developers

  • Choose from Purposes

    Label printing, printer setup and management information.

  • b-PAC

    Information on application development tools for Windows

  • Mobile SDK

    Information on application development tools for mobile terminals

  • Command Reference

    Information on control command reference for label printers and mobile printers

  • Versatile software

    Information on versatile software provided by Brother

  • Choose from Models

    Introduction of Brother tools applicable to your model

  • Video Library

    Videos showing how to use SDK and other information

  • Contact Us

    Fill out the contact us form if you have questions about Brother developer tool.