Visual Studio Development Bookmark and Share   
 index > Visual Studio Tools for Office > Create own class for Microsoft.Office.Interop.Outlook.AppointmentItem
 

Create own class for Microsoft.Office.Interop.Outlook.AppointmentItem

Hi

i want to extend the default functionality in a Microsoft.Office.Interop.Outlook.AppointmentItem object in my Outlook 2007 add-in.
As a necessity of my project, i would like to add custom data to that class, let's say an ID from my database.

After some searching, i realised that the AppointmentItem is an interface which can be implemented in a custom class.
Implementing the interface forces me to implement all its members, which is quite the list!


For example, my custom appointment class:

class

 

MyOutlookAppointment : Microsoft.Office.Interop.Outlook.AppointmentItem

{

 

    private Int32 _myID;

 

    public MyOutlookAppointment(){ }

 

    public Int32 MyID{

 

        get { return _myID; }

 

        set { _myID = value; }

    }


}


Is there a way i could refer to the original object in the properties and methods, so that i do not have to write the logic for each property ?

For example something like this:

#region

 

_AppointmentItem Members

 

public Microsoft.Office.Interop.Outlook.Actions Actions{

 

    get { return parent.Actions; }

}

This could be solved by creating a property Actions in my custom class, and setting/getting that value. But what about the "Save()" method of the AppointmentItem ?

And is this allowed in Outlook 2007? Will the "Outlook.OlDefaultFolders.olFolderCalendar" add my custom object as an appointment?
Steven R.  Thursday, October 15, 2009 1:19 PM
You cannot extend Outlook's core functionality by implementing their OM interfaces (unless the documentation explicitly says that the interface is an "extension" interface and is intended to be implemented by third parties - examples are FormRegions, CustomTaskPanes ..). The implementaiton of AppointmentItem can only be provided by the Outlook.
Misha
  • Marked As Answer bySteven R. Friday, October 16, 2009 7:56 AM
  •  
Misha Shneerson - MSFT  Thursday, October 15, 2009 2:41 PM
You cannot extend Outlook's core functionality by implementing their OM interfaces (unless the documentation explicitly says that the interface is an "extension" interface and is intended to be implemented by third parties - examples are FormRegions, CustomTaskPanes ..). The implementaiton of AppointmentItem can only be provided by the Outlook.
Misha
  • Marked As Answer bySteven R. Friday, October 16, 2009 7:56 AM
  •  
Misha Shneerson - MSFT  Thursday, October 15, 2009 2:41 PM
Okay, thank you for the reply.

I have come with a database structure to support the appointment synchronization on multiple computers without the need for an exchange server. The hard part is that, for as far as i think, the Outlook generated global unique identifiers are different on each computer. i have come with a workaround which stores different outlook id's linked with a certain computer. *sigh*

It would be nice if it were possible to store a personal identifier with each createable item in outlook such as mail items, appointments, ... .

But no need for reply, the workaround gets me where i want to.

Again many thanks.
Steven R.  Friday, October 16, 2009 7:56 AM

You can use google to search for other answers

Custom Search

More Threads

• vsto, excel, copy worksheet code
• MS access password recovery
• ISmartTagRecognizer(2) using Regular Expression ?
• VSTO / ACCESS Developer Active X control - Removed
• office 2007 using visual studio 2008
• It doesn't install PIA & VSTOR
• excell parameters
• How to add a custom Module in Navigation Pane of Outlook 2007 ?
• How to deploy XML Schemas for word 2007?
• Override the VISIO menu