Solved

Extract specific email from Outlook

Posted on 2001-06-08
3
159 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
ID: 6169248
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
ID: 6789790
xlong:

Just a friendly reminder to return to this open question.

thanks!
amp
community support moderator
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7133456
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…

867 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

21 Experts available now in Live!

Get 1:1 Help Now