Monico

Hello,

I would like to know if it's possible to collect appointment's information just using the EntryId. In fact, I can collect all information in the addin, but I would like to open a winform for the user choose other information, and in this form I pass in paramater the EntryId. So in this form, I would like to collect again the appointment's information with this EntryId (or other) like the subject, the recipient ... as it was possible in my addin with this code :

Code Snippet

Object selObject = this.Application.ActiveExplorer().Selection[1];
Outlook.AppointmentItem apptItem = (selObject as Outlook.AppointmentItem);

appItem.Subject;
....



Thank you for your help


Re: Visual Studio Tools for Office Collect information using the EntryId ?

Sue Mosher - Outlook MVP

Your winform can use the Namespace.GetItemFromID method to return the item using its EntryID as an argument. If the item is not in the default store, you will also need to specify the StoreID.





Re: Visual Studio Tools for Office Collect information using the EntryId ?

Monico

Ok. Thank you for your answer. But in fact, I find an other solution. Just pass in parameter to my form the object like this

Code Snippet

Outlook.AppointmentItem apptItem = (selObject as Outlook.AppointmentItem);
Appointment frmAppointment = new Appointment(apptItem);



But, I had an other question who has different to this problem. Do you know how to convert the attachment in a byte[] because next, I would like to save its into a database.

Thank you




Re: Visual Studio Tools for Office Collect information using the EntryId ?

Sue Mosher - Outlook MVP

The Outlook object model provides no way to get an attachment as a byte stream. You'd have to save it to the file system with the Attachment.Add method, then work with it using file methods.





Re: Visual Studio Tools for Office Collect information using the EntryId ?

Monico

OK ! Thank you for all !