Solved

Viewing Outlook Emails by clicking on a hyperlink...

Posted on 2013-06-17
9
442 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
 

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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Learn more about how the humble email signature can be used as more than just an electronic business card. When used correctly, a signature can easily be tailored for different purposes by different departments within an organization.
Outlook Free & Paid Tools
Viewers will learn the different options available in the Backstage view in Excel 2013.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now