c# - How to initialize a write event for all contacts in outlook add in? -
i working on crm solution outlook in c# in visual studio. have added ribbon in inspector window used modifying contact information. crm system (uses seperate program) determines whether contact has been edited checking contact.user2 field (string). currently, when inspector window opened contact, write event initialized contactitem , when user clicks "save," contact.user2 set "true". method works when information modified in full inspector window. problem when in people view, if user double clicks contact, outlook gives editable "preview" of contact's information. need way set user2 true whenever contacts information saved, not when contact window opened.
i tried following: foreach(outlook.contactitem person in searchfolder) { contact = person; contact.write += new itemevents_10_writeeventhandler(written); }
private void written(ref boolean saveplease) { messagebox.show("written " + contact.fullname); //contact.user2 = "true"; }
the messagebox debug purposes. event fire once, list first contact in list's name, not person saved info for. if relevant, after inspector window has been opened contact, write event initialized , "preview" view of contact being saved sets user2 true. or guidance appreciated, thank you!! outlook 2013.
use items.itemchange event on items collection returned mapifolder.items property.
Comments
Post a Comment