Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Viewing Outlook Emails by clicking on a hyperlink...

Posted on 2013-06-17
9
Medium Priority
?
486 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 2000 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
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 

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 Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

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

This article lists the top 5 trialware OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their Exchange server is no longer available or other critical issues with Exchange server or impo…
This article describes how to import an Outlook PST file to Office 365 using a third party product to avoid Microsoft's Azure command line tool, saving you time.
Viewers will learn the different options available in the Backstage view in Excel 2013.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

886 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