Application.CommandLine Method

ClosedDescription

The command line for BarTender to process.

ClosedSyntax

Application.CommandLine(commandLineString)

Where commandLineString contains the command line arguments for the application to process.

ClosedRequirements

Version

BarTender 7.00 or higher

Edition

Automation, Enterprise Automation

ClosedRemarks

BarTender supports automation through the use of command line parameters. Command line parameters are most commonly used to change BarTender's settings, preload an existing BarTender document, or automatically start a print job. A single command line may contain one or more command line parameters giving the ability to group command parameters.

Each call to the CommandLine method puts a command line into a command processing queue internal to BarTender and immediately returns. BarTender then executes each command line sequentially in the order they were placed on the queue. Several command lines may be submitted allowing the caller to stack multiple command lines for execution. BarTender will always processes a command line in the order it was placed on the command processing queue.

The OnCommandLineCompleted event will fire for each command line executed by BarTender. If the /P argument is passed to the application, events can be hooked up to monitor the print job's progress.

For more information about the command line parameters you can use to automate BarTender, refer to Command Line Parameter Reference in the BarTender help.

ClosedVB.NET Example

'Declare a BarTender application variable

Dim btApp As BarTender.Application

'Create a new instance of BarTender

btApp = New BarTender.Application

'Execute a command line to print test.btw

btApp.CommandLine("c:\temp\test.btw ?/p")

'End the BarTender process

btApp.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges)

ClosedC# Example

// Declare a BarTender application variable

BarTender.Application btApp;

// Create a new instance of BarTender

btApp = new BarTender.Application();

// Execute a command line to print test.btw

btApp.CommandLine(@"c:\temp\test.btw ?/p");

// End the BarTender process

btApp.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges);

Related Topics