Hello Ken,
If I hook up the ItemAdd event, it does not fire if I add anything -- even
without the drag and drop.
Here is the code I am using...
public partial class ThisAddIn
{
private Outlook.Application outApp;
private Outlook.NameSpace _nameSpace;
private Outlook.MAPIFolder _calendarFolder;
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
outApp = this.Application;
_nameSpace = outApp.GetNamespace("MAPI");
_calendarFolder =
_nameSpace.GetDefaultFolder(OlDefaultFolders.olFolderCalendar);
_calendarFolder.Items.ItemAdd += new
ItemsEvents_ItemAddEventHandler(Items_ItemAdd);
}
void Items_ItemAdd(object Item)
{
MessageBox.Show("Item Added");
}
private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
{
_calendarFolder.Items.ItemAdd -= new
ItemsEvents_ItemAddEventHandler(Items_ItemAdd);
outApp = null;
}
}
Thanks for your help...
cj
"Ken Slovak - [MVP - Outlook]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> If you add a new item to the calendar folder, not with drag and drop but
> Actions, New Appointment does ItemAdd() fire at all? If not then it's
> something in how you're creating or scoping your event handler.
>
> Is the folder object and items collection declared at a class or other
> scope level that will keep them alive once your procedure where you add
> the event handler ends?
>
> Show the code you use to create the event handlers.
>
> --
> Ken Slovak
> [MVP - Outlook]
> http://www.slovaktech.com
> Author: Professional Programming Outlook 2007.
> Reminder Manager, Extended Reminders, Attachment Options.
> http://www.slovaktech.com/products.htm
>
>
> "Curtis Justus" <(E-Mail Removed)> wrote in message
> news:OtF$(E-Mail Removed)...
>> Hi everybody,
>>
>> I have created an add-in where I need to capture a drag and drop event of
>> an appointment in a user's calendar. I used the ItemLoad event in the
>> 2007 libraries, but that doesn't exist in 2003.
>>
>> I have attached to the Items.ItemChange event of the calendar folder
>> (olFolderCalendar), but that never fires. For that matter, neither does
>> the ItemAdd or ItemRemove events.
>>
>> I have my inspectors hooked up, but they never fire because an inspector
>> is not created on a drag-drop of an appointment.
>>
>> Would anybody have any ideas of something I can try?
>>
>> Thanks for your help,
>> cj
>