PC Review
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook Program Addins
Current Selected Mail Item
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook Program Addins
Current Selected Mail Item
![]() |
Current Selected Mail Item |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
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. |
|
|
|
#2 |
|
Guest
Posts: n/a
|
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 "Phil" <anonymous@discussions.microsoft.com> wrote in message news:155fa01c3c458$f88ca980$a601280a@phx.gbl... > 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. |
|
|
|
#3 |
|
Guest
Posts: n/a
|
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 > > >"Phil" <anonymous@discussions.microsoft.com> wrote in message >news:155fa01c3c458$f88ca980$a601280a@phx.gbl... >> 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. > > >. > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

