Query Prompt Vb.net 追蹤

Legacy Poster

I have a datagrid in vb.net which contains the label name, the quantity and the size.

In VB.Net I am using this code to display a preview:


Private Sub Preview(ByVal Label as String, ByVal Quantity as Integer, Optional ByVal size as String = "0")

Dim btApp As Bartender.Application = Nothing

Dim btFormat As New bartender.Format

btApp = New Bartender.Application

btApp.VisibleWindows = Bartender.BtVisisbleWindows.btInteractiveDialogs


btFormat = btApp.Formats.Open(rPath & label, False, "")

btFormat.PrintSetup.IdenticalCopiesOfLabel = Cint(Quantity)



End Sub


The label FE269011.btw contains a query prompt. How can I populate the query prompt in VB.Net?

I have tried btFormat.Databases.QueryPrompts("Maat").value = Size but VB.Net displays an error: Interface 'Bartender.Queryprompts' cannot be indexed because it has no default property.


1 意見

Ian Cummings
評論操作 永久連結

This example from the BarTender Help system should set you on the right track:


Dim btEngine As New Engine()

' Start a BarTender Engine process 

' Open a label format 
Dim btFormat As LabelFormatDocument = btEngine.Documents.Open("c:\MyLabel.btw")

' Set the QueryPrompt 
btFormat.DatabaseConnections.QueryPrompts("Nutrition Calorie Data").Value = "40 Calories"

' Print the label format 
Dim result As Result = btFormat.Print()