Skip to main content

Search

Search

Format.namedsubstrings Property Error

Comments

5 comments

  • Avatar
    Legacy Poster

    Hi,

     

    To complete the information, today I tried to open the defunct model from another computer running BarTender 10.1 SR1. I got the same error message.

     

    Christophe

    0
  • Avatar
    Ian Cummings
    Moderator

    I suggest you attach an example document and data files to this forum topic so I can take a look at what you're doing.  Not able to figure out what is wrong based on your description alone.

    0
  • Avatar
    Legacy Poster

    Hello Ian,

     

    Sorry for the late answer (I didn't get the nofitication you had posted an answer). Will do that tomorrow or Wednesday.

     

    Thanks

     

    Christophe

    0
  • Avatar
    Legacy Poster

    Hello Ian,

     

    Here is an example. By default the 3 following files have to be copied Inside a BarTender directory at C:\ level. These 3 files are :

    - DATA.txt contains the data to be printed on the label

    - FR.txt contains the French translation of the data zone "titles"  which are printed dynamically

    - Label.btw is the defunct label 

     

    In Label.btw, you will find 4 named data fields :

    Format : I left it but it doesn't seem te be relevant to the problem I experience.

    Langue_1 : should contain the French translation of the first data zone title (label)

    Langue_2 : should contain the French translation of the second data zone title (label)

    Langue_chemin : the directory path where the translation files are. I used this approach to allow path change without having to update the code within the label.

     

    The document OnPrintJobstart event is used to dynamically open the appropriate translation file. This is where the issue is. On line 9, I use Format.NamedSubStrings to read Langue_Chemin value to get the directory path of the translation files. When I run the label I get the "this object doesn't handle the property of method 'format.NamedSubStrings'".

     

    To note : I designed a label with SR1 version using the very same code without experiencing this issue. Interestingly this very label continues to be OK with SR4 (no error triggered).

     

    When I started the design of a new label with SR4 everything was ok. Then sunddenly after adding a new field / object I got that error. I removed the field/object but the problem remained. I closed the label, restarted the computer with no success. I then create a brand new label and copied and pasted from the defunct one. The bug followed. I started again with a brand new label then added the fields and objects one at a time. It worked for the first ones, but suddenly failed. I started again and noted the bug occured randomly preventing me to focus on a specific field or object.

     

    I tested different ways of handling label translations within BarTender and this approach is my favorite. As it seemed to work with SR1, I'm interested to understand why it no longer seems to work (mistake on my side, bug ?). BarTender is run on a Windows 7 / 64 bits.

     

    Thanks for your help

     

    Christophe

    0
  • Avatar
    Ian Cummings
    Moderator
    I suggest you make use of the "External File" data source type as this data source can easily have its path/filename sourced from some other data source such as a database field.  Other label object data sources can then connect to this data source performing various string functions to get the particular data you're wanting to print.
     
    The FIC (Food Information to Consumers) label example on our website uses just such a technique for handling the various language translations for food allergens.  I suggest you take a look at it for implementing this in an easier way than you're trying currently.
     
    0

Please sign in to leave a comment.