Have Outlook search for all conversations with certain email - c#

I wish to have my app initiate a search in Outlook for all mail correspondence with a certain person. I am trying to use the Microsoft.Office.Interop.Outlook API, but I am having problems figuring out exactly how to perform this search or even if what I am attempting to do is possible.
So I do not want to extract the data from Outlook, I want to remote control Outlook to perform the search there.

That can be done with conversations.
MailItem mi = ....
Conversation c = mi.GetConversation();
c.GetRootItems() --> thats the whole correspondence

Related

Outlook custom MailTip on MailItem

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

How to set classification of an email automatically?

I have the following powershell script:
$Outlook = New-Object -ComObject Outlook.Application
$Mail = $Outlook.CreateItem(0)
$Mail.To = "receiver#host.com"
$Mail.Subject = "Hello"
$Mail.Body ="World"
$Mail.Send()
But when I execute it I have to select classification of the email manually: there appears a TITUS pop up with a the "Select Classification" title select box containing the following items: Public, For Internal Use Only and Private. I have to select an item and click "OK", after that the email is sent.
The script is supposed to be a job that gets run on schedule, so I don't want to interact with the script at all.
I have already walked through the whole msdn page of MailItem but I didn't come across anything similar to Classificaiton. What did I miss?
I am not an administrator of the server, so I don't have access to change anything.
PS: I selected the C# tag just because C# has the same API to interact with Outlook
Firstly, Outlook, just like any other Office app, is not designed to be used in unattended scenarios. It can and will display modal prompts out of the blue.
Secondly, to send a message, you can use straight SMTP, EWS, Extended MAPI (C++ or Delphi only), or Redemption (I am its author - its RDO family of objects wraps Extended MAPI and can be accessed for many language).
In your particular case, it sure looks like a custom third-party addin displaying a dialog box.
The mail object is not able to set the classification of the email object. If you pipe the object to Get-Member, you will see that there is no changeable property for the classification and/or a method to change it. You can find this by running the following command:
$Mail | Get-Member
Additionally, if you look at the list of properties there is not one that looks related to classification.
$Mail | Format-List
This blog post will probably help you, but it seems more complex than the solution you're looking for. This one utilizes Exchange instead of the Outlook client.

interrogate the Data in Lync 2010?

I developed a seat plan website - it uses the Lync SDK to pull back user details - (i.e. when a name is clicked on the map it passes the name into the Search box and then lists the person in the results list and then you can start an instant conversation, etc).
I want to possibly expand upon this now and I was wondereing does anyone know if its possible/have any URLS, source code that would allow me to pull back the status of all the people in the office from there Lync status (i.e. available/busy,etc).
Also the other information stored about the person withing Lync - the Office/Mobile/Calendar details - is it possible to pull this off to be used?
If you want to see "real" presence of a user, and recieve realtime updates to that presence, then you need to add the user as contacts in Lync. I'm guessing in your scenario that's not ideal (or even possible) so you'll need to search for contacts, and then query for their presence.
This article should get you started with searching for a contact
Have you looked at the Lync 2010 SDK? I would think that's the place to start...

Outlook VSTO adding tracking pixel

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...

Is there a way to automatically re-send an email according to certain rules with Outlook 2007 and MS Exchange?

I am looking for a solution to the following problem:
My manager wants to automatically send a second message when he sends an email to X and there is no response in two days. If there is no further response in 2 more days, send another message.
Before I start building anything, I wonder if there is already a product/solution that does that? Can anybody recommend an already existing tool?
We use MS Exchange and he uses Outlook 2007.
Auto Follow Up is a tool I've used in the past for this specific purpose. Also, always check www.slipstick.com for listings of Outlook/Exchange add-ins - they seem to be the best source (disclaimer: I have no affiliation with that site or any of its add-ins)
It's not an existing solution, but in case you don't get any answers:
You can use Exchange Web Services to do this: pointing it at his Sent Items folder. So this is basically what you would do:
Use SyncFolderItems against his Sent Items, say every 1 hour. The first time you do this use null as the SyncState, thereafter use the last SyncState the server sent you.
Write them to a SQL table: { ItemId NVARCHAR(MAX), ChangeKey NVARCHAR(MAX), MessageID NVARCHAR(MAX), Sent DATETIME }. MessageID would be the Message-ID header from the message.
Run a query (say once a day) that selects the rows where the Sent value is more than 2 days ago.
Use GetItem to retrieve the original mail and resend (first clearing/deleting Message-ID) it using SendItem.
Delete the selected rows.
These items will land up in the Sent Items folder and will be picked up by your application (as they are actually new mails); and re-processed in 2 days.
Use SyncFolderItems against his Inbox, again maybe every hour (maybe immediately after the first operation against Sent Items). Keep a unique SyncState for this operation.
Grab the In-Reply-To header. Delete any rows with a maching MessageID.
Grab the References header; and split it into a list. Delete any rows with a matching MessageID.
Would this solve your problem:
http://www.followupthen.com/
Perhaps not exactly what you want and it isn't integrated into Outlook.
I don't think you will find exactly what you want. This is functionality which belongs to a CRM, not to email software.
Having said that, the Getting Things Done Outlook Add-In will get you in that direction. It won't automatically send a follow up mail, but it can take care of a notification so you send it yourself. (but this plugin is not free - $75 - you have to decide yourself if that's worth it)
With the GTD add-in you can send a mail, and select the option "Send and Action". After pressing send mail, you can select the action "#Waiting For", and press ok. Now it will create an outlook task, with the subject and contents of the email you sent automatically filled. You can set all the task properties, like end date and notification time.
After two days at the notification time, you get a (default) outlook popup, where you can open the task. With one click you can open the corresponding email and use reply or forward to send your followup. You can create a new task or modify the existing task for the next followup.
If you receive a reply in the mean time, and open the mail, you can use the "related task" button to find the corresponding task to mark it as complete. It also adds buttons like defer and delegate to your mail.
There is a 30-day trial. I am not connected to netcentrics, but I have bought and use this plugin.
Have you looked into automating Outlook using Visual Basic for Applications? If you aren't familiar with VBA, or if the thought of writing VBA gives you nightmares (I've had a few), then you might find some example VBA code on the web that accomplishes something similar to what you are trying to do, and then you could just tweak it. I know you said that you wanted an existing tool, but I thought I would throw this out there as a sort of last resort. It's not ideal, but I'm pretty sure it would solve your problem.

Categories