Feedback will be sent to Microsoft: By pressing the submit button, your feedback will be used to improve Microsoft products and services. Privacy policy. Microsoft Access supports Automation in two ways. From Microsoft Access, you can work with objects supplied by another component. Microsoft Access also supplies its objects to other COM components. You can use the New keyword or the CreateObject method to create a new instance of a component.
You can use the GetObject method to assign a variable to an existing instance of a component. In Microsoft Access, you can set a reference to a component's type library to improve performance when you work with that component through Automation. Microsoft Access also includes the Object Browser, a tool that enables you to view objects in another component's type library, as well as their methods and properties. The Microsoft Access type library provides information about Microsoft Access objects to other components.
You can set a reference to the Microsoft Access type library from a component and view its objects in the Object Browser. To work with Microsoft Access objects through Automation, you must create an instance of the Microsoft Access Application object. Folders are contained in one or more stores.
After you set an object variable to the Outlook Application object, you will commonly set a NameSpace object to refer to MAPI, as shown in the following example.
Once you have set an object variable to reference the folder that contains the items you wish to work with, you use appropriate code to accomplish your task, as shown in the following example.
If you are using VBA to create macros, there are two ways you can automate Outlook. You can implement a macro that creates a new instance of the Outlook Application object. Application to create a new Application object instance. Caution This new instance of Outlook is not trusted and can trigger the object model guard. As an alternative to creating and automating a separate instance of Outlook, you can use VBA to implement a macro that automates the current instance of Outlook.
To do so, use the Application object intrinsic to the environment. This Application object is trusted and can avoid triggering the object model guard. For more information about the object model guard, see What's New for Developers in Outlook Part 1 of 2.
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback. Skip to main content. This browser is no longer supported. Download Microsoft Edge More info.
0コメント