HyperLink to outlook message in public folder

Hi all,

I have successfully created an intranet page with links to e-mails in the users' inbox by using:

<a href="Outlook:00274056408540400004456406065">test</a>

where the number is the actual message's ID I got using the EntryID of the message. What I then did is to move the message to a public folder, but then the link above stops working. I checked the message's ID after I moved it and it stays the same. I have found on the net links of the form:

<a href="Outlook://Public Folders/All Public Folders/~subject>test</a>

but they don't work for me since many times the subject of the messages is identical.

Does anyone know how I can put a link to a message in a public folder using its ID got from the EntryID?

Who is Participating?
David LeeConnect With a Mentor Commented:
There is no way of knowing what the new ID is going to be.  You'll have to retrieve the ID from the moved item.  Without knowing how you are assembling your intranet page I can't advise on how best to go about this.  You can get it easily enough using a simple bit of VBA script.  Something like this:

Sub ShowEntryID()
    Dim olkItem As Object
    Set olkItem = Application.ActiveExplorer.Selection(1)
    MsgBox olkItem.EntryID
    Set olkItem = Nothing
End Sub

This code will display a pop-up dialog-box showing the EntryID of the currently selected item.
David LeeCommented:
Hi gpsbr,

The EntryID of the SHOULD NOT be the same in the public folder as it was in the Inbox.  An item's EntryID is based on the message store the item is in.  Public Folders is a different message store than either an online mailbox or any PST file.  The link syntax for opening an item by its EntryID from a public folder is the same as for opening it from an Inbox.

gpsbrAuthor Commented:
Hi BlueDevilFan,

Just checked what you said and you are right, the ID changes when the message is moved and the link works the same. But how do I know what the new ID is going to be once I move the message?

gpsbrAuthor Commented:
Hi BlueDevilFan,
Just found it. Move is a function, not a sub. all you have to do is:

set test = curitem.move(destinationfolder)

and then


gives you the new ID.

I will give you the points. Thanks for the prompt help!
David LeeCommented:

You're welcome.  Glad I could help out.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.