I have a pretty specific problem, maybe some of you have an idea..
I'm making a VSTO AddIn for outlook, and I managed to show a formregion - first with registry entries, than I figured it out, that I can define with the "Form region Wizard" - on specific Items (like Appointment, Meeting item etc.) but I cannot find a way to show the formregion on undeliverable message item, sent by System Administrator.
Any Suggestions? Which Item could it be?
Thanks.
Each item in Outlook has a message class associated with it. In your scenario you deal with a ReportItem. Here is what MSDN states for that object:
The ReportItem object is similar to a MailItem object, and it contains a report (usually the non-delivery report) or error message from the mail transport system. Unlike other Microsoft Outlook objects, you cannot create this object. Report items are created automatically when any report or error in general is received from the mail transport system.
And the form region is usually associated with a particular message class. The report item has the REPORT.IPM.Note.NDR string for the message class. It seems you just need to specify the right message class for your form region.
Related
Good Morning,
Since a few days, I'm searching for an opportunity to change colours in Outlook by VSTO (Visual Studio Tools for Office - C#).
I would like to change the colour of the recipient, which I write down when I would like to send an e-mail.
Is that even possible?
I don't find anything on the web about that, but it would be the best solution for my project.
The Outlook extensibility model doesn't provide anything for customizing the Outlook UI, i.e. changing colors of the recipients.
The best what you could do is to use the ContactItem.Categories property which allows setting a string representing the categories assigned to the Outlook item.
Categories is a delimited string of category names that have been assigned to an Outlook item. This property uses the character specified in the value name, sList, under HKEY_CURRENT_USER\Control Panel\International in the Windows registry, as the delimiter for multiple categories.
Is it possible to modify an Outlook MailItem object to display a Mailtip with custom text? It doesn't look to be possible using the OOM, how about at the MAPI layer, i.e. using Redemption?
If not possible, is there some way to achieve a similar effect? (e.g. Ribbon XML, etc.)
mailtip example
The best you can do is add a category - it will be displayed in the same area.
The tip itself comes from Exchange server as a result of an EWS call. There is no way to display custom data there.
I am not sure if you are still interested in possibilities to display MailTips based on your own rules with your own texts: There is an Outlook add-in called MailScout allowing that (mailscout-app.com). Kind regards
I am creating my first Addin for Outlook 2010, it's for using emojis that are added to the email body when a button on the custom ribbon is pressed.
I currently have it so that when a button is pressed the corresponding emoji is added to the end of the email.
My main issue is that I don't want to just add the emoji at the end of the HTMLBody but at the current location of the cursor, is there any way to do this with Outlook 2010?
I tried using this tutorial.
However any use of Application.Selection gives me an error cs1061: "Application does not contain a definition for Selection...", I'm assuming that this is because I'm using Outlook 2010 and not Outlook 2013 or later but correct me if I'm wrong.
All and any help is greatly appreciated.
Application.Selection refers to the Word Object Model, but you are using Outlook's Application. What you need is Application.ActiveInspector.WordEditor.Application.Selection (where Application.ActiveInspector.WordEditor in OOM returns the Document Word Object Model object corresponding to the editor window of the active Outlook inspector).
Whenever an email is sent, I want someaction to be performed(we active this action by clicking some button that appears in the ribbon in the compose email window).
I think this action need to be performed from sent items.
So, I want to create a table or a simple list that stores the ids(or something unique) while sending an email. And then whenever an email appears in sent folder, I will check if it is in the list or table that we created previously.
So,
How to create, add data to those tables?
Is this a good way to perform action on the sent items ?
Is there any unique and common element(like some id) between compose email 'mailitem' and sent emails 'mailitem' ?
Thanks.
What tables are you talking about?
It is up to you when to perform an action. I don't see enough information in your post to suggest something else. If you want to get a valuable feedback I'd recommend describing your final goal in depth. However, you may also consider handling the ItemSend event of the Application class.
Outlook uses the EntryID property value (string) to identify items. Here is what MSDN states for the entry IDs:
A MAPI store provider assigns a unique ID string when an item is created in its store. Therefore, the EntryID property is not set for an Outlook item until it is saved or sent. The Entry ID changes when an item is moved into another store, for example, from your Inbox to a Microsoft Exchange Server public folder, or from one Personal Folders (.pst) file to another .pst file. Solutions should not depend on the EntryID property to be unique unless items will not be moved.
But you are free to add your own IDs. You can use user properties to store them. See the corresponding property (UserProperties) of Outlook items for more information.
You can add a user property (MailItem.UserPropertiers.Add) when a message is composed, and then look for a message with that property in the Sent Items folder. In general, you cannot use the EntryID property since it changes when a message is moved from one folder to another (PST provider is the only exception)..
You can store your list/table as a user property on a hidden message in any folder of your choosing, e.g. the Inbox. See MAPIFolder.GetStorage on MSDN. You can see existing Outlook's hidden messages in OutlookSpy (I am its author) - go to the Inbox folder, click IMAPIFolder button on the OutlookSpy toolbar, go to the "Associated Contents" tab, double click on any of the hidden messages to see it properties.
I'm adding an img tracking pixel to items that have embedded content using my outlook addin which allows me to track when the person has open the email (pretty standard practice)
I do this by adding an image tag right before the closing body tag upon the send event.
The problem is, outlook then calls the url three times (twice with a method of "OPTIONS" and once with "GET"), this defeats the whole purpose of the tracking pixel because it triggers the event on send.
Does anyone know why outlook makes these requests, or how to get around this?
I see two possibilities:
Either Outlook or Exchange Server is checking the eMail content before sending it
OR
Outlook is configured to “When an HTML message contains pictures located on the Internet, send a copy of the pictures instead of the reference to their location” - for changing that setting in Outlook 2007/2010 via Registry see http://www.msoutlook.info/question/72
BTW: the two OPTIONS calls let me believe that Outlook is somehow checking the server of the linked image for WebDAV and/or Frontpage extensions...