Application Object

The Application object represents the Outlook application and is the topmost object in the Outlook object model. VSTO wraps the Interop Application object and provides a ThisApplication class when you create a new Outlook add-in project. In the ThisApplication class, you can access the properties, methods, and events of the Application object by using the Me keyword, as shown in Figure 10.11. Note that Outlook has restricted methods and properties that can cause an Outlook security warning to be displayed if the object is not accessed through ThisApplication. You'll learn more about this later in this chapter in the section "Security in Outlook Add-ins Created with VSTO."

Private Sub ThisApplication_Startup[EiyVal sender As Object, ByVal e As System.EventArgs) _ Handles He.Startup

Private Sub ThisApplication_Startup[EiyVal sender As Object, ByVal e As System.EventArgs) _ Handles He.Startup

¿ft outlookInspector_NewInspector

d

End Parent

^ ProductCode

^ Quit

ReferenceEquals

J fef^ïÉi?®.

Public Overrldable Readonly Property Remlnders() As Microsoft. Off ice. Interop. Outlook, Reminders

5eteSon

Gets a Reminders collection that represents all current reminders.

Site

¿ft StartCaching

¿ft StopCaching

If Tag

¿ft ThisApplication_Shutdown

¿ft ThisApplication_Startup

ToString

Version

Common | All

Figure 10.11. Using the Me keyword to access methods and properties of the Application object in the ThisApplication class

Figure 10.11. Using the Me keyword to access methods and properties of the Application object in the ThisApplication class

0 0

Post a comment