PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook Program Addins Current Selected Mail Item

Reply

Current Selected Mail Item

 
Thread Tools Rate Thread
Old 17-12-2003, 04:48 AM   #1
Phil
Guest
 
Posts: n/a
Default Current Selected Mail Item


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.
  Reply With Quote
Old 17-12-2003, 05:07 AM   #2
Paul Overway
Guest
 
Posts: n/a
Default Re: Current Selected Mail Item

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.



  Reply With Quote
Old 17-12-2003, 08:58 PM   #3
Phil
Guest
 
Posts: n/a
Default Re: Current Selected Mail Item

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.

>
>
>.
>

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off