Format.namedsubstrings Property Error Follow
I'm currently working on an intertionalization of text label with BarTender 10.1 SR4. The translated texts are stored in different text files stored on disk. The BTW label uses the OnPrintJobStart document event to read the proper translation file depending on the content of a database field using the code below.
Instead of storing the files' path Inside the VBScript code, I've used a text integrated data named "Langue_chemin" to store it. When the event is triggered the Format.NamedSubStrings method is used to read the value of the "Langue_chemin" data. During the development process everything worked just fine. When I launched previews I got my label preview (with the proper translation). At the end of the design I saved again the model then closed BT. When I opened it again and tried to preview or print the label, I got an error message telling me the "Langue_chemin" object didn't have the Format.NamedSubString property.
I tried to create a new label based on a copy of another label designed previously with the SR2 (same design, code, event handling and working fine with SR4). Once again I got the same error after saving the file.
I tried to move the source code within other events, or directly inside a WBScript integrated object event thinking the issue could be related to an earlier call of a object which is not yet properly initialized but it didn't fix the issue.
Would you have an idea about ?
' Name of the translation file
language_file = Field("DATA.Champ 1") & ".txt"
' Read files' path from integreted data
language_path = Format.NamedSubStrings("Langue_chemin").Value
fichier = language_path & language_file
Please sign in to leave a comment.