Current Selected Mail Item

  • Thread starter Thread starter Phil
  • Start date Start date
P

Phil

Hello all,
I am currently writing an Outlook 2002 AddIn using VB6 but
I am having difficulty returning the currently
selected/highlighted email message within the Inbox.
What I have at the moment just returns the last email
message not the selected message.

Set myInbox = olns.GetDefaultFolder(olFolderInbox)
MsgBox myInbox.GetExplorer.Selection.Item(1).Subject

NOTE
I don't want the user to have to open the email therefore
the objOutlook.ActiveInspector option is not what I am
after.

Any help on the matter would be greatly appreciated.
 
Although not specific to the Inbox, this should work (does for me anyway):

Set objExplorer = olApp.ActiveExplorer
Set objSelection = objExplorer.Selection
Set objTemp = objSelection.Item(1)

Where olApp is your Outlook application object.
 
Thanks Paul, that works a treat...

Phil.
-----Original Message-----
Although not specific to the Inbox, this should work (does for me anyway):

Set objExplorer = olApp.ActiveExplorer
Set objSelection = objExplorer.Selection
Set objTemp = objSelection.Item(1)

Where olApp is your Outlook application object.

--
Paul Overway
Logico Solutions, LLC
www.logico-solutions.com





.
 
Back
Top