Monday, 15 July 2013

.net - Modifying a copy/paste item in Outlook prior to save (C#) -



.net - Modifying a copy/paste item in Outlook prior to save (C#) -

i wrote outlook plug-in (for utilize in outlook 2010) client syncs user's outlook databases third-party application. works fine. however, 1 thing client wants leverage standard copy/paste functionality duplicate records in outlook. issue define userproperty outlook record has been sent third-party scheme (it stores internal id third-party system). when client performs copy/paste, userproperty copied (which bad creates multiple records same third-party id). wondering if there way observe via code copy/paste occurring , create modification in record (removal of userproperty) prior save. might perform on tasks, appointments, or contacts, need guidance apply across board.

per suggestions below, attempted leverage beforeitempaste, seen below:

private void thisaddin_startup(object sender, system.eventargs e) { globals.thisaddin.application.activeexplorer().beforeitempaste += new outlook.explorerevents_10_beforeitempasteeventhandler(item_beforeitempaste); } private void item_beforeitempaste(ref system.object clipboardcontent, microsoft.office.interop.outlook.mapifolder target, ref bool cancel) { system.windows.forms.messagebox.show("trying paste"); }

the message appears first time copy/paste, , never again. tried leveraging application.explorers, theoretically gives me access explorers in outlook, didn't give me access individual ones (appointment, task, contact) looking (there 1 element in 'array' when debugged it). also, tried access specific explorer items invoking mapifolder.getexplorer, returned null.

try utilize explorer.beforeitempaste event.

c# .net plugins outlook copy

No comments:

Post a Comment