Solved

Viewing Outlook Emails by clicking on a hyperlink...

Posted on 2013-06-17
9
452 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Windows running painfully slow? Try these tips..

Stay away from Speed Up Computer Programs that do more harm than good.
Try these tips instead.
Step by step instructions in trouble shooting Windows Performance issues.

Question has a verified solution.

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

Are you unable to connect or configure Hotmail email account in Microsoft Outlook 2010, 2007? Or Outlook.com emails are not downloading to Outlook? Lets’ see the problem and resolve Outlook Connector error syncing folder hierarchy (0x8004102A).
Large Outlook files lead to various unwanted errors and corruption issues. Furthermore, large outlook files can also make Outlook take longer to start-up, search, navigate, and shut-down. So, In this article, i will discuss a method to make your Out…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

759 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