Accessing control events of email form - vsto

I am trying to develop an add-on for outlook which requires handling control changes.
For instance I need to do some stuff when email subject is changed. To do this, I need to access text change event of subject texbox.
I was just wondering whether anyone has done such thing or not?
Thanks

Check the PropertyChange event:
Occurs when a standard property (for example, Subject or To) of a
Microsoft Outlook item is changed. The property name is passed to the
event so that you can determine which property was changed.

Related

Custom appointment form is different when opening appointment

I have made a custom form region for my appointments in outlook - Which I really would like to use.
However, I have a problem with implementing it in my outlook.
When I want to schedule a new appointment, it opens up the correct form that I want to use - and works without any issues.
However, the problem occurs when I want to open and see my appointment. Here, it shows some previous published version - Which of cause does not properly work.
Things I have tried
I don't remember, that I at any time specified a default form to use upon opening an appointment. But the way it acts, it seems like I did.
I have tried deleting and republish my form with a different name
I have tried specifying "When posting to this folder, use" for my calendar
Still, it keeps opening already scheduled appointments with a completely different form, that I made several days ago.
Every Outlook item has the class name set, so that is how Outlook knows which form should be used to display the item. See Associate a form region with an Outlook message class for more information.
Also, you may take a look at the Assign a custom form to existing Outlook items article.

VSTO Outlook AddIn: How to handle event when AppointmentItem.Body changes

I tried to catch the event when the AppointmentItem.Body changes. Handling the PropertyChange on the AppointmentItem does not get called when I type in text or save the AppointmentItem. It gets called when I hit the button "Add Participants though".
Best would be to get the Keydown on the body editor?
The Outlook object model may not propagate changes made in the Outlook UI until you switch focus to another field and/or save the item. This is a well-known issue when dealing with the Outlook object model.

How to capture the tick event of the task checkbox on 'Outlook Today'? VSTO Add-in

I'm developing an Outlook Add-in, and currently I have no idea on how to capture the task's checkbox (mark complete) tick event -- particularly on the 'Outlook Today' view. I'd like to override it with my own function.
Refer to the attached image as reference to the checkbox being referred to.
Outlook Today Task
The Outlook Today page is not a typical area that can be integrated with. It is possible though, as it is basically an .html page; see: https://technet.microsoft.com/library/cc750169.aspx. However, this is 20 year-old technology...
If you are mainly interested in trapping changes to that task, then you can trap the Items.ItemAdd event for the Tasks folder and do whatever you like with the modified Task.
The Outlook object model doesn't provide anything for the Outlook Today page. It just lists items from your folders. So, you may consider handling the following events to get the job done:
The ItemChange event of the Items class which is fired when an item in the specified collection is changed.
The PropertyChange event of Outlook items which is fired when an explicit built-in property of an object is changed.
Both events are fired when you mark the task as completed. But in case of the PropertyChange event you need to subscribe to each task item individually which is not really convenient.

Is there an event when user types a subject?

I want to autofill a subject based on what the user types in to the subject field of an email. For example, the user starts typing T201234567 and the program will fill in the rest.
T201234567 SR9&54 Project title
I found the event for when a new email is created, but I would ideally like to have this program be as unobtrusive as possible, so it would only suggest titles, as the user is typing in something it recognizes.
So, is there an onKeyPress event for the subject field?
No, there is no such event. PropertyChange ("Subject") event will fire only when the user tabs out of the Subject edit box.
You can find the control's handle using Win API and intercept its Windows messages, but you cannot do that in VBA.

Interaction between custom forms and event receivers

How can we interact with custom forms and event receivers? How can we talk to custom fields (asp controls) within the custom form from an event recievers?
I searched but cant find something like that or maybe I am not using the right keywords.
In the event receiver you do not have access to any of the controls on a form. What you do have is access to the SPItemEventProperties object which has the BeforeProperties and AfterProperties, er... properties. These are hashtables which contain the names of the SPListItem's fields and their corresponding values (from the form or from the existing item). You can use the event receiver to inspect these values and take a particular action, or even cancel the event.