Outlook How to fire Drag and Drop event of outlook appointment using C#?

Joined
Nov 10, 2011
Messages
5
Reaction score
0
Hi friends....

How can we fire Drag and Drop event of outlook appointment using C#. My actual requirment is user don't drag and drop the appointment. I need to cancel the drag and drop.

Bobbin
Thanks & Regards
 

EvanDavis

Silly Fool
Joined
Jun 20, 2010
Messages
5,299
Reaction score
681
Outlook already has a feature to disable drag and drop.No need for any C#
 
Joined
Nov 10, 2011
Messages
5
Reaction score
0
Hi Evan

Actually i have an outlook addin project. In this project i am downloading and uploading the appointment items from CRM to outlook and to opposite direction. Some appointment items download from CRM dont change in outlook. So i need to cancel the edit option. So i cancel the write function

Code:
public void NewItem_Write(ref bool Cancel)
        {
            Cancel = true;
        }

this function only work after we select the appointment and then drag. If we directly drag an appointment it will not fire. This is my problem. please help me to over come this problem.

thanks
Bobbin
 
Joined
Dec 10, 2011
Messages
2
Reaction score
0
Check out this code..... it might be useful for you.
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;

}
}

For more details please check out this link..

http://www.codeproject.com/KB/office/outlook_drag_drop_in_cs.aspx

http://forums.asp.net/t/1138955.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top