Solved

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

Posted on 2010-08-16
8
1,504 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
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 
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
 

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

Learn to move / copy / export exchange contacts to iPhone without using any software. Also see the issues in configuration of exchange with iPhone to migrate contacts.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Many of my clients call in with monstrous Gmail overloading issues with Outlook. A quick tip is to turn off the All Mail and Important folders from synching. Here is a quick video I made to show you how to turn off these and other folders in Gmail s…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

813 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

10 Experts available now in Live!

Get 1:1 Help Now