MeetingItem saved; but change now shown in Calendar - vsto

I updated meeting item in Application_ItemSend event handler, the "sent" message shows the change; however on my calendar, the change doesn't show up. What's wrong?

Why do you expect the change to show in the AppointmeentItem if you never modified it?
Have you tried to open the corresponding appointment using MeetingItem.GetAssociatedAppointment and modify it as well?

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.

Outlook VSTO-AddIn: Prevent Outlook from deleting an appointment

I try to prohibit in certain cases that the user deletes an appointment. Something like this:
User clicks on appointment in calendar
User selects delete
VSTO-Addin checks whether this is allowed and shows a warning dialog in case if not. Outlook does NOT delete the appointment!
Currently I attached to Item_Delete_Add() and I think that one can only handle the deletion but you cannot prevent outlook from actually deleting the appointment. Correct?
You are on the right avenue... The Items.ItemRemove event is fired when an item is deleted from the specified collection. This event does not run when the last item in a Personal Folders file (.pst) is deleted, or if 16 or more items are deleted at once from a PST file, Microsoft Exchange mailbox, or an Exchange public folder. Moreover, you must keep the reference to the source object to know which item is being deleted from a folder. To get this working you must subscribe to the SelectionChange event of the Explorer class. It is fired when the user selects a different or additional Microsoft Outlook item programmatically or by interacting with the user interface. So, you could subscribe to every selected item and know which item exactly is removed.
Another possible way is to handle the AppointmentItem.BeforeDelete event which is fired before an item (which is an instance of the parent object) is deleted. An instance of the item being deleted is passed as a parameter. In order for this event to fire when an email message, distribution list, journal entry, task, contact, or post are deleted through an action, an inspector must be open. The event occurs each time an item is deleted. It also allows to cancel the actions by setting the second parameter - if the event procedure sets this argument to true, the operation is not completed and the item is not deleted.
Yet another approach is to repurpose ribbon controls, see Temporarily Repurpose Commands on the Office Fluent Ribbon for more information.

Intercept OnSend event after attachment reminder

In Outlook Web Add-In, I'm trying to intercept OnSend event which is triggered when sending an email.
I used this example in GitHub which is working fine.
If I include the word "attachment" in the email body and I click Send button, OnSend event is fired for the first time so I can do some processing to email's content. However, after a while, a pop-up modal window shows up with this message:
Attachment reminder
You may have forgotten to attach a file.
with Send and Don't send buttons. If click Send, OnSend event gets fired a second time. This time, It would be useless to repeat the same email processing. So, I'm looking for a way to find out that the second OnSend event is fired after an Attachment reminder.
Is there a way to distinguish between first and second OnSend events?
Thanks for your question, Mhd! This appears to be unintentional behavior, essentially a defect that we will look into fixing. ItemSend event should inter operate with forgotten attachment detection nicely, and should only be raised after the detection happened. In other words, the first event should not be called at all. Is it a problem if you do the processing twice until this issue is resolved?

auto-move email back to Inbox on flagged due date

I am wondering how I can make it so when flagged e-mails are due they move from some folder to the Inbox.
Essentially, I have written some VBA that makes Outlook work like Inbox by Google. The VBA:
lets me "snooze" e-mails in the Inbox for a number of days I pick and hide it (using view filters)
if a new e-mail comes in matching a "snoozed" e-mail then it categories the message with a message so when I open the e-mail I'll know there are e-mails in the same conversation that are hidden
when the a "snoozed" email's timer is up it automatically shows back up in the Inbox
Right now my code "hides" the e-mail by using View filters:
"http://schemas.microsoft.com/mapi/proptag/0x10900003" = 1 OR
"http://schemas.microsoft.com/mapi/proptag/0x10900003" = 0 OR
"http://schemas.microsoft.com/mapi/id/{00062003-0000-0000-C000-000000000046}/81050040" <= 'Today' OR
"urn:schemas:httpmail:messageflag" IS NULL
However, I was thinking, instead of hiding it I should move "snoozed" e-mails to another folder.
The part I'm stuck with is moving the e-mails back to the Inbox after their timer is up.
I guess I need some way to hook into something that triggers when a flagged e-mails due date has approached?
The reason I want to do this is because if someone sends me an email that they have flagged then because my view filter hides all flagged messages the e-mail will come in as hidden and I won't see it until its due.
One option is to trap the Application.Reminder event, which supplies the Item object which triggered the event. However this requires that flags also have a reminder set on them. The only other alternatives is to scan the Mailbox on a timer or Outlook start - or the ToDo List - and calculate the due dates for every flagged item.
You can do this client-side using a view filter. This is outlined really well on this website, but I'll post a summary here for completeness.
Create a new snooze view
Click on View tab.
Click Change View.
Select Save Current View As a New View... from the menu.
Give a name to the new view like Snooze Email or To-do list View.
Select All Mail and Post Folders option from the radio button.
Click OK.
This new view is not compulsory to create but this creation will give you the option to go back to your original view smoothly whenever you like to do so.
Apply filters
Click on View Settings under the View tab.
Click on Filter... button.
Click on Advanced tab.
To define a criterion, select the Field > Frequently-used fields > Due Date.
Select does not exist Condition from the drop-down list.
Press Add to List.
To add another criterion, select the Field > Frequently-used fields > Due Date.
Select On or before Condition from the drop-down list.
In Value field, type Today.
Press Add to List.
To add the third criterion, select the Field > Frequently-used fields > Flag Status.
Select not equal to Condition from the drop-down list.
In Value field, select Completed.
Press Add to List.
Click OK.
As soon as you press OK, all the email with due dates provided or completed flag will disappear from your inbox. Mail with due dates will reappear on your inbox on the due date.
Apply Flags
Right-click on the flag (symbol) against the top-most email in your inbox.
Select an appropriate option (when do you want to reappear the email in the inbox?)
Just to remind you that setting an item to This Week will set the reappear/due date to the upcoming Friday and Next Week will set it to the following Monday. You can choose Custom... to set any specific date you want to have it reappear as well, even telling Outlook to throw a reminder if you like.
This is an important step. The first time it may seem tedious, but there is an alternative to do that by using the move to folder tool for the emails which do not require your actions.
How to snooze the whole email conversation?
Because most of the readers are asking this question, I thought I should include it in the article.
If you are using the conversation view in the outlook, follow few more steps.
Open the conversation by clicking on the triangle on the left.
Select the subject line of the email conversation.
Apply flag to the subject line (whole email conversation).
Start Snoozing Email
Once you have applied filter, all you need to do is when you receive any new email, you just need to provide a flag to it. It will reappear at your convenient date, until that day it will be out of sight, out of mind. So you do not need to worry about the emails which are not important to you. Rather deleting it, you can mark them with Completed Flag Status and it will be disappeared forever. (Tip: You can use Quick Step Done to do it with one click.)
If you ever wish to see all the emails again, go back to View tab and change to your original view.

Handle ItemChange event when outlook appointments are dismissed

I have created some macros to forward my calendar events from my work email to my personal email. One component is a ItemChange event that will update my personal calendar when items change on my work calendar. I am having a problem in that every time I dismiss an appointment reminder in outlook it triggers the "itemchange" event. I am trying to develop something to prevent my item change procedures from running when a reminder is dismissed. Anyone have an idea how to handle this? Does anyone know what property of the AppointmentItem changes when a reminder is dismissed?
You cannot do that. When you dismiss a reminder, a couple properties are set and the appointment is saved. A change is a change.
I guess ReminderSet is set to False when a Reminder is dismissed.