Before sending the appointmentItem in outlook 2010 I have created an extended property and set some values. The property is not available for the recipient (recipients are using outlook and they are from the same domain).
However, the property is available in the owner's calendar item.
Any inputs about this issue is much appreciated.
Keep in mind that ApointmentItem object is never sent - Outlook creates a MeetingItem object and sends. The original ApointmentItem remains in the Calendar folder.
You can try to use Application.ItemSend event - Outlook will pass MeetingItem as the parameter, and you should be able to set the extra properties. Now where these properties will be copied by Outlook from MeetingItem in the Inbox to the new ApointmentItem is a different question...
I have already replied to your post on MSDN forums two days ago:
The fact is that a meeting item is not sent to a recipient. Instead, a corresponding meeting request is created and sent to the recipient. Just check the message class of the item when the item is sent. You can handle the ItemSend event of the Application class which is fired whenever an Microsoft Outlook item is sent, either by the user through an Inspector (before the inspector is closed, but after the user clicks the Send button) or when the Send method for an Outlook item.
Related
I have an Outlook VSTO add-in. I want to respond to incoming emails. This works quite well with the declaration
Public WithEvents items As Outlook.Items
And the definition for the items that are observed. (I'm afraid that's why only "Inbox" is watched):
inbox = objOutlook.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox)
items = inbox.Items
and the eventhandler
Private Sub Items_ItemAdd(ByVal item As Object) Handles items.ItemAdd
Even if Outlook is closed, an event is triggered for each new email when Outlook is started.
I've now noticed that some users of the add-in have created a rule that moves incoming emails to a subfolder of "Inbox". In this case, the Items_ItemAdd event is not fired when a new email arrives.
How can I also capture these new emails that are moved via a rule?
The item is moved on the server side by the server side rule, and even if Outlook was running, it could've been moved before Outlook downloaded the original item to the OST store. So if ItemAdd event fires, it only fires on the folder where the item was moved to, not in the Inbox folder.
Besides watching the Inbox folder, you'd need to watch the other folders that the rules might point to - retrieve the rules using Store.GetRules(), loop through all rules, check if Rule.MoveToFolder action is enabled, and if yes, retrieve the target folder from MoveOrCopyRuleAction.Folder property.
Use the NewMailEx event of the Application class which is fired once for every received item that is processed by Microsoft Outlook. The item can be one of several different item types, for example, MailItem, MeetingItem, or SharingItem. The EntryIDsCollection string contains the Entry ID that corresponds to that item.
The NewMailEx event fires when a new message arrives in the Inbox and before client rule processing occurs. Use the Entry ID returned in the EntryIDCollection array to call the NameSpace.GetItemFromID method and process the item.
Also you may track the items in the folders by combining multiple mechanisms like this event handler plus getting new items at startup to not skip any of them that was added silently. The Find/FindNext or Restrict methods of the Items class can help you with such tasks. Read more about that in the series of articles:
Outlook NewMail event unleashed: the challenge (NewMail, NewMailEx, ItemAdd)
Outlook NewMail event: solution options
Outlook NewMail event and Extended MAPI: C# example
Outlook NewMail unleashed: writing a working solution (C# example)
I would like to see if there is any way that anyone replies in a shared mailbox to any email and the email is automatically flagged in outlook. Can be via Power Automate or VBA.
One way or another, you would need to set the MailItem.Categories property and/or MailItem.ReminderSet / ReminderTime properties on the original item in the folder.
You can use Explorer.SelectionChange event to track the item selection, set up MailItem.Reply/ReplyAll event handlers on the item(s) from the Explorer.Selection collection, and then set the reminder properties in the event handler. Or you can use Explorer.InlineResponse event to set up the properties on the first item in the Explorer.Selection collection
In outlook, I want all the people sending me emails with the object as "testintro" let's say, to be replied with their OWN email. I want them to receive exactly what they sent me. Is it possible to create that rule?
Yes, it is possible. But not with a rule. Instead, you can develop a VBA macro.
You can create a VBA macro where you could handle the NewMailEx event of the Application class. The NewMailEx event fires when a new message arrives in the Inbox and before client rule processing occurs. Use the Entry ID returned in the EntryIDCollection array to call the NameSpace.GetItemFromID method and process the item. This event fires once for every received item that is processed by Microsoft Outlook. The item can be one of several different item types, for example, MailItem, MeetingItem, or SharingItem.
So, you may get an instance of the arrived mail item and call the Reply method to reply instantly. The method creates a reply, pre-addressed to the original sender, from the original message. You may find the following articles helpful:
How To: Create and send an Outlook message programmatically
How To: Fill TO,CC and BCC fields in Outlook programmatically
How To: Change an Outlook e-mail message before sending using C# or VB.NET
is there any chance to make the following scenario working
user gets email in Outlook containing link/text/object
clicking the object runs simple VBA code (i.e. replace string in txt) file on users computer
Thank you.
No, it is not possible. This is a potential path for malware.
Instead, you can handle the NewMailEx event of the Application class in Outlook VBA macros where can detect such mails (with a specific text or links) and run your business logic accordingly.
The NewMailEx event fires once for every received item that is processed by Microsoft Outlook. The item can be one of several different item types, for example, MailItem, MeetingItem, or SharingItem. The NewMailEx event fires when a new message arrives in the Inbox and before client rule processing occurs. You can use the Entry ID returned in the EntryIDCollection array to call the NameSpace.GetItemFromID method and process the item.
When I reply to a mail i would get the Draft of the Reply from the Explorer object and not the Original mail with an expression like application.ActiveExplorer.Selection.Item(1).xxxx .
The expression application.ActiveExplorer.Selection.Item(1) give the original mail not the "reply Draft".
Thanks for answer
Desag
Outlook 2013 introduces a new property for the Explorer class – ActiveInlineResponse. It allows getting an item which is listed in the Outlook 2013 reading pane in case the inline response is active.
For handling inline replies Outlook 2013 introduces a new event which notifies developers when the inline response is activated – the InlineResponse event.