Solved

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

Posted on 2010-08-16
8
1,485 Views
Last Modified: 2012-05-10
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?
0
Comment
Question by:mattinvt
  • 3
  • 3
  • 2
8 Comments
 
LVL 3

Assisted Solution

by:dockhand
dockhand earned 150 total points
ID: 33448504
If you also store the EntryId (a MailItem property)  you could then later select the item with that id.  You might think of the MailItem.EntryId as a "GUID" for each mail item.
0
 
LVL 76

Expert Comment

by:David Lee
ID: 33449192
Hi, mattinvt.

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

Author Comment

by:mattinvt
ID: 33456858
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.

0
 
LVL 3

Expert Comment

by:dockhand
ID: 33457198
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

0
Want to promote your upcoming event?

Are you going to an event? Are you going to be exhibiting at a tradeshow? Talking at a conference? Using a promotional banner in your email signature ensures that your organization’s most important contacts stay in the know and can potentially spread the word about the event.

 

Author Comment

by:mattinvt
ID: 33459070
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)

0
 
LVL 76

Accepted Solution

by:
David Lee earned 200 total points
ID: 33459237
1.  I'm not on a computer with Redemption right now.  If I remember correctly the syntax would be something like

    GUID = RedemptionObject.Item.EntryID

2.  To loop through the items in your inbox folder

    Set olkInbox = Session.GetDefaultFolder(olFolderInbox).Items
    For Each olkMsg in olkInbox
        GUID = olkMsg.EntryID
    Next
0
 

Author Comment

by:mattinvt
ID: 33544021
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.
0
 
LVL 76

Expert Comment

by:David Lee
ID: 33547470
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
0

Featured Post

Promote certifications in your email signature

Has your company recently won an award or achieved a certification? They'll no doubt want to show it off. Email signature images used to promote certifications & awards can instantly establish credibility with a recipient and provide you with numerous benefits.

Join & Write a Comment

Sometimes Outlook might have problems sending a message. There may be various causes- corrupted PST, AV scanner etc. The message, instead of going to the Sent Items folder, sits in the Outbox indefinitely. To remove it you can use a free tool cal…
Local Continuous Replication is a cost effective and quick way of backing up Exchange server data. The following article describes the steps required to configure Local Continuous Replication. Also, the article tells you how to restore from a backup…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
This video discusses moving either the default database or any database to a new volume.

708 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

15 Experts available now in Live!

Get 1:1 Help Now