Inspector Current Item does not return subject information (Appointment)

Add-in Express™ Support Service
That's what is more important than anything else

Inspector Current Item does not return subject information (Appointment)
 
Li Hock Chan


Guest


I am trying to retrieve the subject from appointment item. However, I am only able to detect it on second load. Below are the scenarios I had tested.

(1) New Appointment Item -> Change Subject -> Click on form -> subject detect as null
(2) New Appointment Item -> Change Subject -> Click on form -> subject detect as null -> click back to appointment item -> Click back to form -> Subject detected
(3) New Appointment Item -> Change Subject + Date Time -> Click on form -> subject detected
(4) New Appointment Item -> Change Subject + Body -> Click on form -> subject detected
(5) New Appointment Item -> Change Subject + Past Date Time -> Click on form -> subject detect as null
(6) New Appointment Item -> Change Subject + Past Date Time -> Click on form -> subject detect as null -> click back to appointment item -> Click back to form -> Subject detected.

Another weird behavior, when I run into debug mode, I used dynamic view on the appointment item, I will be able to detect the subject as intended.
Posted 20 Feb, 2017 23:18:18 Top
Andrei Smolin


Add-in Express team


Posts: 18825
Joined: 2006-05-11
Hello Li,

Save the item before you retrieve a property.


Andrei Smolin
Add-in Express Team Leader
Posted 21 Feb, 2017 02:30:14 Top
Li Hock Chan


Guest


Will it create the item permenantly?
Posted 21 Feb, 2017 04:46:42 Top
Andrei Smolin


Add-in Express team


Posts: 18825
Joined: 2006-05-11
It will save the item. You may need to delete it.


Andrei Smolin
Add-in Express Team Leader
Posted 21 Feb, 2017 04:52:49 Top
Li Hock Chan


Guest


Hi,

However when we was using VSTO to get the subject, we didn't have this issue. As user may change their mind while creating the appointment and decide to just close the window. Is there anyway to get the latest Property information without having to save it?
Posted 22 Feb, 2017 05:17:09 Top
Andrei Smolin


Add-in Express team


Posts: 18825
Joined: 2006-05-11
Hello Li,

The Subject property starts returning the value typed in the Subject field after you set the focus to another field within the Outlook inspector window; say, you can try to type the subject and then focus the To field.

An alternate way is to save the item.


Andrei Smolin
Add-in Express Team Leader
Posted 22 Feb, 2017 05:44:39 Top
Li Hock Chan


Guest


I understand about that. But this was not the behavior of the VSTO. When I entered the subject, click on the form region icon, the subject got populated.

However, when I entered the subject, click on the arrow to load ADXOIForm, the subject is null but the DateTime captured is correct. Is there anything or any way we can do about this?
Posted 22 Feb, 2017 07:57:56 Top
Andrei Smolin


Add-in Express team


Posts: 18825
Joined: 2006-05-11
The control behind the Subject field in the Inspector window only sets its string to the Subject property when it loses the focus. That is, if you click on a control located on the form, you'll get the Subject property, not null. Below is a workaround for the scenario when you click the form itself (not a control on it).

Copy this code in the code of your ADXOlForm. Does this work for you?


protected override void WndProc(ref Message m)
        {
            base.WndProc(ref m);
            if (m.Msg == 0x021) //WM_MOUSEACTIVATE
            {
                Focus();
            }
        }



Andrei Smolin
Add-in Express Team Leader
Posted 22 Feb, 2017 08:38:22 Top