Link to home
Start Free TrialLog in
Avatar of mattinvt
mattinvt

asked on

Open message from inbox in Outlook 2000 Inbox using VBA / CDO / Redemption / Message ID

Hello -

I'm using  Outlook 2000 / VBA / CDO / Redemption / Exchange 2003.

In Access, I cycle through the inbox and build a table of Message Subject / Message ID / Sender.

I want to be able to open the original mail item in the Outlook message interface by passing the Message ID.

Can this be done?
SOLUTION
Avatar of dockhand
dockhand

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of David Lee
Hi, mattinvt.

Yes, it's possible using the GetItemFromID method of Outlook's Session object.
Avatar of mattinvt
mattinvt

ASKER

Ok, that's good.

- How to cycle through each item to get Redemption.PR_ENTRYID
- I've tried all sorts of methods to open the message on the Entry ID without luck.

This should help you select your items
sSearchString = "[EntryID] = '" & sEntryID & '"'
Dim moNameSpace As Object

myFolder = myNameSpace.GetDefaultFolder(mlFolderSentMail)  '<---- choose your default folder constant here
Set olEmail = myFolder.Items.Find(sSearchString)

Open in new window

This code is where I'm at
Set Session = CreateObject("Redemption.RDOSession")
Session.Logon
Dim GUID As String
Set myOlApp = CreateObject("Outlook.Application")
Set myNameSpace = myOlApp.GetNamespace("MAPI")
Set Session = CreateObject("Redemption.RDOSession")
GUID = (140 Character ENTRYID string copied from a email msg via Outlook Spy)
Set olitem = myNameSpace.GetItemFromID(GUID)
olitem.Display

This works as it should..

However
1 - I can't seem to read the 140 character ENTRYID from Redemption.PR_ENTRYID
It returns a 9 charater string instead.

2 -Furthermore,  How do I loop through my inbox (default) to read each msg's ENTRYID (140 charater ID)

ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Any ideas why all instances of
Set olitem = myNameSpace.GetItemFromID(GUID)
would bail with an "The Operation  Failed error Message"

I'm ditching Outlook 2003 for Outlook 2000 which is more of the standard here.

So I switched from Outlook 11 object library to Outlook 9 object library.

That's the only thing that changed.
It's been a long time since I did anything in Outlook 2000.  I'd start by checking to make sure that GUId contains a valid EntryID