Chapter 1 -- 6
Programmer’s Guide
Intheexamplebelow,theservernameisspecified.Usethis
parameter if you have several versions of your labeling software
to open the document.lab with the correct version.
Dim MyApp As Object
Set MyApp = GetObject (”c:\ProgramFile\docu-
ment.lab”,”Lppx2.Application”)
Note that in the example below the Visual Basic for Application
expression G etObject(,”Lppx2.Application) will fail unless the
Application (the labeling software) is already running. If the
Application is not already running, a new instance will not be
launched.
Dim MyApp As Object
Set MyApp = GetObject (,”Lppx2.Application”)
In this example, the variation of the GetObject syntax varies
from the previous example in that a new instance of the applica-
tion will always be launched even if the application is already
running. This variation is equivalent to a CreateObject state-
ment.
Dim MyApp As Object
Set MyApp = GetObject (””,”Lppx2.Application”)
The key word New can only be used if you work with the Type
Library (see: What is the type library).
New assigns an object reference to a variable or to a property.
Syntax
SetMyApp={[New]objectexpression}
This example demonstrates reation of the MyApp object that
represents Application. This is the standard access to get the
subordinated objects of Application.
Dim MyApp As LabelManager2.Application
Set MyApp = New LabelManager2.Application
New
function