c# - getting the most current value of Subject line of an Outlook AppointmentItem -


I have a problem accessing the actual typed text in the subject area of ​​an appointment item. I have an Outlook 2010 add-in In which a custom button from the ribbon has a callback, except the subject field except I can get the value of if someone is clicking on the button after typing the subject (and not changing the control focus) . In these cases I am getting the last price of the subject and not in the recently typed value. (I'm getting a zero value for a newly created meeting invitation).

  Public Zero Toggle Mitinge Placeback (office.IRibbonControl control) {if ((control! = Null) & ( Control.id = "Toggle Meeting Place")) {var item = control.Context as Outlook.Inspector; If ((item! = Null) & amp; (item.CurrentItem! = Tap)) {Outlook.AppointmentItem m_item = item.CurrentItem as Outlook.AppointmentItem; String subject = m_item.subject; // some actions}}}  

However, if I start debugging then I see some interesting behavior in the clock window: - m_item.subject still returns the old values But if I set up a watch for MITM and then expand the dynamic members, which are suddenly updated to the current value.

I think in this case there are some side effects of dynamic visuals that come in handy ... I can not understand how to do this with code.

This is happening because you cursor in the subject area of ​​your item if you remove the focus from the subject fields If so, it will work.

Yes, you are right in detail with the dynamic view, suddenly the subject text appears, but it is due to my delay or some reason I do not know.


Comments