We recommend using Visual Studio 2017
This documentation is archived and is not being maintained.

Working with Shared Office Components

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Microsoft® Office includes a set of shared objects available in all Office applications that help you search for files, use the Office Assistant, manipulate command bars, read and write document properties, read and write script, and hook add-ins to your Office application. Because these objects are shared among all Office applications, it is easy to write code that uses these objects and that will run without modification from within any Office application or custom Office application.

You can use these objects to customize the appearance of your application, create custom toolbars and menu bars in code, perform custom file searches, or customize the Office Assistant to respond to the user's actions.

In This Section

Referencing Shared Office Components
Return a reference to a shared component object by using the appropriate properties.
Working with the FileSearch Object
Programmatically access the functionality of the Office File Open dialog box.
Working with the Office Assistant
Use the objects, methods, and properties of the Office Assistant object to programmatically control the Office Assistant.
Working with Command Bars
Write code to manipulate command bars that can be used in any Microsoft® Office application or custom application you develop.
Working with Document Properties
Use document properties to create, maintain, and track information about a Microsoft® Office document.
Working with Scripts
Access script, or insert script into a cell or range in a Microsoft® Excel worksheet, a Microsoft® PowerPoint® slide, a Microsoft® Word document, or Word Selection object.

Related Sections

Developing Office Applications Using VBA
Every custom application is, in some sense, an answer to a particular problem or requirement. When you understand the problem, the success of your application will depend on your ability to deliver a response that uses appropriate tools tailored to the experience level of the people who will be using your application.
The Benefits of Office Programmability
Quickly and easily build and deploy custom desktop applications and take advantage of the objects exposed by Microsoft® Office applications, so your custom applications can leverage existing, proven, and tested Office functionality.
Office Objects and Object Models
Learn about developing a Microsoft® Office application — from writing a simple Microsoft® Visual Basic® for Applications (VBA) procedure to creating a sophisticated financial analysis and reporting application.
Working with Office Applications
Take advantage of different objects, collections of objects, properties, methods, and events to build your application.
Getting the Most Out of Visual Basic for Applications
Write code that is fast, efficient, easy to read and maintain, and, if possible, reusable with a solid working knowledge of Microsoft® Visual Basic® for Applications (VBA) — what features the language includes and what you can do with it.
Add-ins, Templates, Wizards, and Libraries
Create and use COMAddIn objects (a shared Microsoft® Office component in the Microsoft Office XP object library).