Share via


Working with Microsoft Publisher Objects

When you write Microsoft® Visual Basic® for Applications (VBA) code that calls into Microsoft® Publisher, you treat Publisher as a collection of Visual Basic objects, where each object has methods and properties that either return Publisher's state or cause Publisher to do something. The object model is the entire interface you see — all of the Publisher functionality is somewhere in the tree of exposed objects. This nicely encapsulates the functionality of Publisher in an easy-to-browse, standard way, so anyone who has programmed (for example) Microsoft® Word has a good chance of understanding Publisher. It provides an object-oriented face to Publisher. A number of concepts and technologies make it possible for Publisher to respond to Visual Basic, including: IDispatch, reference counting, object creation, type library interpreting, error handling, lifetime management, and collection enumeration.

In This Section

  • Understanding the Publisher Application Object
    Use properties or methods of the Application object to control or return the Microsoft® Publisher application-wide attributes, to control the appearance of the application window, and to get to the rest of the Publisher object model.
  • Working with Office Applications
    Take advantage of different objects, collections of objects, properties, methods, and events to build your application.
  • Working with Microsoft Access Objects
    Use Form, Report, and DataAccessPage objects and the controls they contain to format and display data and make it possible to add or edit data in a database.
  • Working with Microsoft Excel Objects
    Use Microsoft® Visual Basic for Application (VBA) to work with Microsoft® Excel objects, from either within Excel itself or another Microsoft® Office XP application to gain access to every part of Excel.
  • Working with Microsoft Outlook Objects
    Create custom Microsoft® Outlook® objects and manipulate those objects from within Outlook, from another application using Microsoft® Visual Basic for Application (VBA) code from within Outlook, or from another Microsoft® Office XP application by using automation.
  • Working with Microsoft PowerPoint Objects
    Automate Microsoft® PowerPoint® by using the Application object, from which you can open an existing Presentation object or create a new presentation.
  • Working with Microsoft Project Objects
    Build powerful custom applications easily with the Microsoft® Project object model.
  • Working with Microsoft Word Objects
    Use Microsoft® Visual Basic for Application (VBA) to work with the Microsoft® Word Document object, Application object, and Documents collection.
  • Working with Microsoft Visio Objects
    Design, model, and manage complex enterprise-level systems with the sophisticated toolset provided by Microsoft® Visio® products.