Solved

Extract specific email from Outlook

Posted on 2001-06-08
3
146 Views
Last Modified: 2010-05-02
Hello,

1. I would like to find out which email item is currently
highlighted by the user and get the EntryID of the highlighted mail item. Any body has any idea?

2. If i do not want to put the code for (1) in a macro,
can i compile an exe or something like that, and put it
as a button on Outlook? Actually my intention is to
hide the code from the user (since i can't do that with macro)

Any answer appreciated.
Thanks
0
Comment
Question by:xlong
3 Comments
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 25 total points
Comment Utility
I don't believe there is a way to know which item is selected. However you can get the EntryID for each item in the Inbox as follows:

Dim objApp As Outlook.Application
Dim objInbox As Outlook.MAPIFolder
Dim objItem As Object 'Not all are MailItems

Set objApp = New Outlook.Application
Set objInbox = objApp.GetNamespace("MAPI").GetDefaultFolder(olFolderInbox)
For Each objItem In objInbox.Items
   Debug.Print objItem.EntryID
Next
Set objApp = Nothing

Hope this helps,
Anthony
0
 

Expert Comment

by:amp072397
Comment Utility
xlong:

Just a friendly reminder to return to this open question.

thanks!
amp
community support moderator
0
 
LVL 49

Expert Comment

by:DanRollins
Comment Utility
Hi xlong,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will suggest to:

    Accept acperkins@devx's comment(s) as an answer.

xlong, if you think your question was not answered at all or if you need help, you can simply post a new comment here.  Community Support moderators will follow up.
==========
DanRollins -- EE database cleanup volunteer
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

772 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

11 Experts available now in Live!

Get 1:1 Help Now