Solved

Viewing Outlook Emails by clicking on a hyperlink...

Posted on 2013-06-17
9
449 Views
Last Modified: 2013-06-19
I am looking for a way to be able to view an email by clicking on a link.

Essentially, I am trying to keep track of certain emails in an external/third party program.  This program simply display a list of the email subjects.  When clicking on the link, the full text of the email is displayed.

Also, I was originally thinking that I could do this by using the PR_ENTRYID as the message's unique identifier, but reading further on this identifier, it appears that the PR_ENTRYID can change depending on a few different factors.

I can't seem to find too much on doing this, or I am looking in the wrong location.  Any help at all is greatly appreciated.

Thanks in advance!

Phoenix-2
0
Comment
Question by:Phoenix_2
  • 5
  • 4
9 Comments
 
LVL 76

Accepted Solution

by:
David Lee earned 500 total points
ID: 39255659
Hi, Phoenix-2.

This page explains how to hyperlink to an Outlook item.
0
 

Author Comment

by:Phoenix_2
ID: 39256701
Thanks BlueDevilFan for the response.

I had already been scouring those pages and had seen the page(s) you linked.  I tried adding the registry entry yesterday and had no luck.  I decided to try it again this morning, and low and behold it worked!  There must have been a type in my entry.  However, I did get it working and the results are what I was looking for.

Now, this leads me into another question.  Everything that I have read points me to the PR_ENTRYID as the GUID that I want, however, the PR_ENTRYID changes depending on how the datastores are set up.  In addition, the PR_ENTRYID changes depending on which folder the message is placed into.  Nowhere have I been able to find reference to a GUID that is unique to the message at all times.

Would you happen to know if there is a GUID/UID that is unique to each message that never changes?  In addition, would you know how to grab this unique id without using third party tools like the MAPI editor that I am using?

Thanks in advance,

Phoenix-2
0
 
LVL 76

Expert Comment

by:David Lee
ID: 39256831
You're welcome.

Outlook items do not have a true GUID.  EntryID is the closest Outlook comes to having one.  An item's EntryID should not change so long as the item is not moved from one store to another (e.g. from a PST file to another PST file, from an Exchange mail store to PST file).  If you can't be certain that an item will remain in the same store, then the best suggestion I know of is to store the message in the file system.  You could then link to it with a file URL.
0
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 

Author Comment

by:Phoenix_2
ID: 39256875
Is there a way to extract the EntryID (PR_ENTRYID) without using a 3rd party too such as a MAPI Editor?

I suppose that I could write some code to extract the value, storing the value in a database table, and the message on the file system.

Thanks again for all of your time.

Phoenix-2
0
 
LVL 76

Expert Comment

by:David Lee
ID: 39256954
Yes, you can extract the EntryID with any programming language that can access Outlook's object model.  For example, in VBA you'd use

SomeVariable = Item.EntryID

where SomeVariable is a variable and Item is an Outlook item (e.g. message, contact, appointment, etc.).
0
 

Author Comment

by:Phoenix_2
ID: 39257030
Yes, yes, yes!  I should have known that!  Brain is fried!

Thanks again for your time!

Phoenix-2
0
 
LVL 76

Expert Comment

by:David Lee
ID: 39257231
You're welcome.
0
 

Author Comment

by:Phoenix_2
ID: 39257892
BlueDevilFan (and all other experts) ~

I have another question in regards to Outlook and Outlook Web Access (OWA).  I have an email that I would like to view via OWA.  I have used a MAPI editor to grab the PR_ENTRYID from the email message.  I would like to convert the PR_ENTRYID to the Exchange Web Services Id (EWS) so that I can create the URL And display the email through OWA.

Here is what I have done:

PR_ENTRYID = 0000000034E9C2678E77E6448CDC18FFB30C89CC07005735D6F34030134A80136D21A793BDD7000000E3750700005735D6F34030134A80136D21A793BDD700000188F4F40000" ;

I have a function that I have created (many examples out there on the web) that takes care of the converting of the ids.

string ConvertHexEntryIdToEwsId(ExchangeService service, string entryId, string mailbox)
{
    AlternateId hexEntryId = new AlternateId( IdFormat.HexEntryId, idToConvert, mailbox);
    AlternateId ewsId = service.ConvertId(hexEntryId, IdFormat .EwsId) as AlternateId;

    Console.WriteLine("Hex Entry Id: " + hexEntryId.UniqueId);
    Console.WriteLine("EWS Id: " + ewsId.UniqueId);

    return ewsId.UniqueId;
}

The result of the function call is:
AAMkADlkNTE1MzMxLWYzMzctNDdmNi05OWFkLWYxYmU0ZTk2ODJhMQBGAAAAAAA06cJnjnfmRIzcGP+zDInMBwBXNdbzQDATSoATbSGnk73XAAAA43UHAABXNdbzQDATSoATbSGnk73XAAABiPT0AAA=

However, in the actual URL that I have in OWA, it should be:
RgAAAAA06cJnjnfmRIzcGP%2bzDInMBwBXNdbzQDATSoATbSGnk73XAAAA43UHAABXNdbzQDATSoATbSGnk73XAAABiPT0AAAA

Needless to say, that if I use the AAMk... id, I get an error.  If I use the RgAAA... id, it displays the message perfectly.

I have tried going backwards, converting the EWS Id into the Hex/Entry Id, but I get errors there too.  Because of this, I really feel that I am either using the wrong conversion, or I have missed a step.

It really seems like this would be straight forward.  What am I missing?  Any thoughts?

Thanks in advance,

Phoenix-2
0
 
LVL 76

Expert Comment

by:David Lee
ID: 39258857
I've no experience with Exchange Web Services.  That said, the code in this example looks a bit different than what you posted above.  How about giving it a try?
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

MS Outlook is a world-class email client application that is mainly used for e-communication globally.  In this article, we will discuss the basic idea about MS Outlook, its advanced features, and types of MS Outlook File formats.
Many people use more than one email account and so it becomes difficult for them to manage them when they use separate accounts,  so, in this article, I have shared an easy way to add Other Mail Accounts in your Google Inbox. It helps to combine all…
Viewers will learn how to maximize accessibility options in an Excel workbook for users with accessibility issues.
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question