Open topic with navigation
A BarTender document can be saved by calling any of the following methods:
-
The Application.Save method saves all documents currently open in the BarTender application.
-
The Format.Save method saves the specified document.
-
The Format.SaveAs method saves the specified document to a specified path and file name. This method is used to save a copy of the document to a different location or file name.
The following examples opens a BarTender document, and saves a copy of the file to a different file name.
'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)
// 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