Hi,
We were looking for an option to open a specific email on Microsoft Outlook client without having to resort to Interop with friend Javi. If one wants to data of why not use Interop you invite some reeds and it speak because has more problems that a movie of Friday 13. But good to what they were going, when you launch Outlook, executable can pass a series of commands to make it open in a specific folder, restart, etc.
One of these options allows you to select a folder [outlook.exe /select folder: {folderName}] but while it is possible to also open an email, there is no example that is fast on this. So based on the example of LISP from this link, modify the Outlook macro to show us the EntryID for the selected mail.
1: 'Adds a link to the currently selected message to the clipboard
2: Sub AddLinkToMessageInClipboard()
3:
4: Dim objMail As Outlook.MailItem
5: Dim mailId As String
6:
7: 'One and ONLY one message muse be selected
8: If Application.ActiveExplorer.Selection.Count <> 1 Then
9: MsgBox ("Select one and ONLY one message.")
10: Exit Sub
11: End If
12:
13: Set objMail = Application.ActiveExplorer.Selection.Item(1)
14: mailId = "outlook:" + objMail.EntryID
15: MsgBox mailId
16:
17: End Sub
And then we launched from the command line with the statement:
1: outlook.exe /select outlook:{ENTRYID}
Where is {ENTRYID} the ID of the element in the Outlook client.
This has much more history behind, because if you work with Exchange, there are several IDs to keep in mind, but this is subject for another post.
Greetings @ Home
The Bruno.
Source: http://superuser.com/questions/71786/can-i-create-a-link-to-a-specific-email-message-in-outlook

Leave a comment