跳至主內容

搜尋

搜尋

Bartender substring check

評論

3 條評論

  • Avatar
    Andy Hurst

    Once you open a label with this: LabelFormatDocument currentLabel = engine.Documents.Open(labelPath, PrinterName);
    Then currentLabel.Substrings should have all your named substrings. The substring object has a name and value property. 

    1
  • Avatar
    Kardo Aia

    Hi Andy,

    Yes but how do I check that substring exists?

    If I run 

    format.SubStrings["SN"].Value
    

    And named data source "SN" doesn't exist in the lable then what answer do I get?

    I'm trying to automate as much as possible and in this case tring to eliminate the danger that when lable format changes  and named data sources (if we receive lable files from client, they don't have them) aren't created for new version then the program doesn't allow it to be used.

    0
  • Avatar
    Lubin Chen

            bool found = false;
            foreach (var btSubString in btFormat.SubStrings)
            {
                if (btSubString.Name == "SN")
                {
                    found = true;
                    break;
                }
            }

    0

登入寫評論。