Working Across Applications
Visual Basic can create new objects and retrieve existing objects from many Microsoft applications. Other applications may also provide objects that you can create using Visual Basic. See the application's documentation for more information.
To create an new object or get an existing object from another application, use the CreateObject function or GetObject function:
|
Most applications provide an Exit or Quit method that closes the application whether or not it is visible. For more information on the objects, methods, and properties an application provides, see the application's documentation.
Some applications allow you to use the New keyword to create an object of any class that exists in its type library. For example:
|
In this case,
|