Skip to main content



Pass .net Variable To Label Format ? V9.3



  • Avatar
    Legacy Poster

    Hi DaveC,

    Sorry you didn't get help sooner. 

    I'm a new Bartender user (just installed it a new hours ago), but I found the examples you'll need.

    When you install Bartender, be sure to install Automation version (or Enterprise Automation). During the install, select advanced and check the option to install .NET SDK examples. Once installation is completed you'll find a folder installed on your system "Bartender .NET SDK". Open that and look in "Print Engine API Samples" > "LabelPrint". You'll find projects for both C# and VB. The path on my machine is "C:\Program Files\Seagull\BarTender Suite\SDK\Print Engine API Samples\LabelPrint" but it may be different on yours depending on where you installed.

    If I was Seagull I'll just put these sample apps on github. then the community should more easily discuss and maintain the code with issues trackers and pull requests.


  • Avatar
    Legacy Poster

    Also in the BarTender .NET SDK Documentation see "Changing Text and Barcode Data on the Label Format"

    Modifying Named Substrings
    Named substrings not only can be read, but they can be modified programmatically. The following code demonstrates how to modify named substrings.
    In C#:


    Engine btEngine = new Engine(); 
    LabelFormatDocument btFormat = btEngine.Documents.Open(@"c:\MyLabel.btw");
    btFormat.SubStrings["Address"].Value = "1313 Mockingbird Lane, Anywhere, USA"; 
    btFormat.SubStrings["Name"].Value = "John Doe"; 
    btFormat.SubStrings["Quantity"].Value = "10"; 

Please sign in to leave a comment.