Using Visual Basic 6.0

All of the examples in this help are for VB.NET or C#. If you are using Visual Basic 6.0, you will have to adapt the VB.NET examples to the Visual Basic 6.0 syntax. Here are some general points to keep in mind:

The Application object is a top level object in BarTender hierarchy. It references other BarTender objects and can be used to set application wide options.

ClosedTo access the Application object from Visual Basic

  1. Set a reference to the BarTender application.

    This can be done from Visual Basic by selecting References from the Project menu, and selecting BarTender from the Available References list box. If you are using Visual Basic for Applications (i.e. supported by Microsoft Office Suite and other programs), the References dialog can be found in the Tools menu.

  2. Declare an object variable of type BarTender.Application using the Dim command.

  3. Start a new BarTender, or access a running BarTender, by creating (or getting) a reference to the BarTenderApplication object and setting it to the object variable defined in the step above.

  4. Quit the BarTender application using the Application.Quit method of the Application object.

For example, the following Visual Basic 6.0 code will start a new copy of BarTender and quit:

Dim btApp As BarTender.Application

Set btApp = CreateObject("BarTender.Application")

btApp.Quit

If you would like to reference a BarTender application that is already running then use the GetObject function in place of the CreateObject function.

Now that you have an application object with which to work, you can set many of its properties to control the global behavior of BarTender. For example, the following code makes BarTender visible after it has been started.

Dim btApp As BarTender.Application

Set btApp = CreateObject("BarTender.Application")

btApp.Visible = true

Related Topics