Adding a lync meeting fires appointmentItem.write event even appointment has not been saved yet RRS feed

  • Question

  • Hi,

    i have outlook 2010 and lync 2013 installed. i have addin which is monitoring AppointemntItem.write event, now i create a new appointement and as soon as i click on lync button Appointmentitem.write event fires and i have not clicked on send button yet.

    Has anybody come across this issue? or is there anyway i can detect that a lync action has happened , so that i can add an appropriate action in  Appointmentitem.write event.

    This does not happen outlook 2013.



    Wednesday, February 4, 2015 12:11 PM

All replies

  • Hello Nitin,

    Have you installed the latest updates for Outlook 2010? Could you please the build number of your Outlook?

    Did you check out the EntryID value after? Was the item saved?

    Anyway, you may repurpose the Ribbon button in Outlook. See Temporarily Repurpose Commands on the Office Fluent Ribbon for more information.

    Wednesday, February 4, 2015 12:39 PM
  •  Hi Eugene,

    i have just done all updates on my machine, my version for outlook is below, items are being saved fine, Actually its just messing up with my addin, its firing write event when its not suppose to , which in my case while adding a lync meeting and as i said it only happens in outlook 2010, 2013 does not fire write event when clicking on lync button. 


    Wednesday, February 4, 2015 1:47 PM
  • Try to repurpose the ribbon button instead of relying on the Write events. I think it will solve the issue in your add-in.
    Wednesday, February 4, 2015 1:52 PM
  • Hi,

    But i do not understand why should i have to do that in this way as outlook 2013 is working fine with my addin and lync. its a lync issue with outlook 2010 

    if i follow  the example given in link , i will be ending up with adding a new button which might confuse our users.

    is there any other way to know if write event was fired was actually a lync action?

    if repurpose is the only option , then is there anyway that without addin any extra button we can re-purpose save button, also can we repurpose only for appointments/meetings?


    Wednesday, February 4, 2015 2:40 PM
  • I thin this is the fastest way to avoid the issue you met on the way. Or do you think it will be changed tomorrow?
    Wednesday, February 4, 2015 3:01 PM
  •  i understand it will not changed tomorrow, but if some one can confirm that this is an issue with outlook 2010 then i can go ahead an try re-purposing.

    Also, for re purposing the xml provided in the example, is it valid for outlook 2010 as well. i have not done anything before. do you have any example for outlook 2010?


    Wednesday, February 4, 2015 4:17 PM
  • The Ribbon UI was introduced with Outlook 2007. Nothing has been changed so far.
    Wednesday, February 4, 2015 4:37 PM
  • ok, somehow i made repurpose working for me. but i think there are some scenarios which i think did not work for me.for example i tried to repurpose save functionality

    1 ) pressing cntrl+s to save an appointment does not go into my repurpose action

    2) closing an inspector window when you made some changes in appointment, outlook reconfirm "do you want to save changes" pressing yes does not go into repurpose

    can i do anything about these scenarios?.

    Wednesday, February 4, 2015 5:56 PM
  • According to the initial post you had to repurpose the Lync button, not the Save one. Why do you need to repurpose the save button on the ribbon?
    Wednesday, February 4, 2015 9:04 PM
  • I thought I can not repurpose lync button, if I can I would love to do that, is it the same way we repurpose save button? App ology I misunderstood your suggestion.
    Wednesday, February 4, 2015 11:27 PM
  • i am not able to find id for lync button, i googled it, but its not mentioned even in controls list
    • Edited by Nitrup Thursday, February 5, 2015 12:02 AM
    Thursday, February 5, 2015 12:01 AM
  • Hi Nitrup,

    Is that issue just occur in the environment of outlook 2010 with lync 2013 or it has the same issue in the environment of outlook 2010 lync 2010?

    Could you reproduce that issue in other machine?

    You may provide the related code of monitoring AppointmentItem.Write event.



    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, February 5, 2015 9:48 AM
  • As i mentioned i found this with outlook 2010 and lync 2013. one of our user has lync 2010 they also have the same issue. yes its replicable on other machines as well.

    Public Class ddlAppItem
     Public WithEvents AppInspector As Outlook.Inspector
     Public WithEvents AppItem As Outlook.AppointmentItem
     Public Owner As New DDLMSOI
     Private Sub AppItem_Write(ByRef Cancel As Boolean) Handles AppItem.Write
    'my addin specific code goes here but because lync alos fires _write event and messes up with flow of my addin, right now i do not have any way to know that whether _write event fired from lync action or while  saving
    end sub
    end class
    Public Class DDLMSOI
     Dim WithEvents AppInspectors As Outlook.Inspectors
     Public Sub Initialize_handler(ByVal Application As     Outlook.Application)
    AppInspectors = Application.Inspectors
    end sub
    Private Sub AppInspectors_NewInspector(ByVal Inspector As Microsoft.Office.Interop.Outlook.Inspector) Handles AppInspectors.NewInspector
    Dim dAppItem As New ddlAppItem
            Dim CurrentItem As Object = Nothing        
            CurrentItem = Inspector.CurrentItem
    If (InStr(CurrentItem.MessageClass, "IPM.Appointment") = 1 _
                Or (InStr(CurrentItem.MessageClass, "IPM.OLE.CLASS") = 1 And InStr(Inspector.Caption, "Appointment") > 0)) _
                And (CurrentItem.MeetingStatus <> OlMeetingStatus.olMeetingReceived) And (CurrentItem.MeetingStatus <> OlMeetingStatus.olMeetingReceivedAndCanceled) Then
                    CurrentItem = TryCast(Inspector.CurrentItem, Outlook.AppointmentItem)
    dAppItem.AppItem = CurrentItem
    dAppItem.AppInspector = Inspector
                    dAppItem.Owner = Me
    end sub
    Public Class ThisAddIn
        Dim ApptEventHandler As New DDLMSOI
    Private Sub ThisAddIn_Startup(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Startup
    end class

    Thursday, February 5, 2015 10:30 AM
  • Hi Eugene,

    I tried to repurpose the lync button by addin following line in ribbon xml

    <command idMSO = "UCMakeMeeingButton" onAction="mySave" />

    but that does not seems to work. let me know what else i can try.


    Friday, February 6, 2015 9:11 AM