Saving BarTender Documents

A BarTender document can be saved by calling any of the following methods:

The following examples opens a BarTender document, and saves a copy of the file to a different file name.

ClosedIn VB.NET

'Declare a BarTender application variable

Dim btApp As BarTender.Application

'Declare a BarTender document variable

Dim btFormat As New BarTender.Format

'Create a new instance of BarTender

btApp = New BarTender.Application

'Open a BarTender document

btFormat = btApp.Formats.Open("c:\Format1.btw", False, "")

'Save the document out as a different name

btFormat.SaveAs("c:\DemoAuto.btw", True)

'End the BarTender process

btApp.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges)

ClosedIn C#

// Declare a BarTender application variable

BarTender.Application btApp;

// Declare a BarTender document variable

BarTender.Format btFormat;

// Create a new instance of BarTender

btApp = new BarTender.Application();

// Open a BarTender document

btFormat = btApp.Formats.Open("c:\\Format1.btw", false, "");

// Save the document out as a different name

btFormat.SaveAs("c:\\DemoAuto.btw", true);

// End the BarTender process

btApp.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges);

The Format.SaveAs method takes two arguments. The first argument, required, is a string containing the path and file name of where to save the document. The second argument, optional in VB.NET and required in C#, is a Boolean: if it is true, the method will overwrite a existing file if it exists in the destination directory.

Related Topics