Needed Introduction Label Design/vba Follow

0
Avatar
Legacy Poster

I'm trying to create a "basic" label.  IF someone could point me in the right direction; Would be much appreciated.   I'd like to create 1 field or Variable on my label.

I'd like to print to this label from VBA. At the time of print; I would like to assign that variable with data I want to see on the label from my VBA project. Here is an example of what I have so far

 

Sub TestPrinting()
    Dim btApp As BarTender.Application
    Dim btFormat As BarTender.Format
    
    Set btApp = New BarTender.Application
    Set btFormat = New BarTender.Format
    
    btApp.Formats.Open ("C:\Users\Bob\Desktop\Test\mc.BTW")
    
    btApp.Visible = True
    
    
    btFormat.SetNamedSubStringValue "SomeData", "1234567"
    
    btApp.ActiveFormat.IdenticalCopiesOfLabel = 2
    btFormats = btApp.ActiveFormat.PrintOut(False, False)
    
    btApp.Quit (btDoNotSaveChanges)
End Sub

 

I've looked over the instructions, but am lost as to how I create such a basic label in bartender.

Very confusing.  I just continue to recieve error messages about data source  "SomeData" not found; even though I've created it..  I've probably missed a step.

1 comments

0
Avatar
Domingo Rodriguez
Moderator
Comment actions Permalink

You not only need to create a data source, you need to give it a shared name. Open the properties for the text object in question, select your "Data Source" on the left pane, select the "Data Source" tab on the right pane and now click on the button which is on the same line as the "Name" field. Here is where you give your datasource a shared name of "SomeData", which is the variable name you will later fill via your VBA application.

 

In previous versions of BarTender, the steps are slightly different, but the same concept remains.

 

 

Please sign in to leave a comment.