PC Review


Reply
Thread Tools Rate Thread

Current Selected Mail Item

 
 
Phil
Guest
Posts: n/a
 
      17th Dec 2003
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
 
 
 
 
Paul Overway
Guest
Posts: n/a
 
      17th Dec 2003
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" <(E-Mail Removed)> wrote in message
news:155fa01c3c458$f88ca980$(E-Mail Removed)...
> 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
 
Phil
Guest
Posts: n/a
 
      17th Dec 2003
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" <(E-Mail Removed)> wrote in

message
>news:155fa01c3c458$f88ca980$(E-Mail Removed)...
>> 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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
create new mail item from current item lindstrom Microsoft Outlook VBA Programming 4 25th May 2010 02:24 AM
How To Get Currently Selected Mail Item In Outlook NeilS Microsoft VB .NET 0 13th Feb 2006 05:33 PM
Code to move selected mail item Evan Microsoft Outlook VBA Programming 1 22nd Apr 2004 06:24 PM
New mail doesn't display until I change from the selected item Patty Microsoft Outlook Installation 0 2nd Oct 2003 02:58 PM
How to sync combo's selected item to the field's value of the current record George Padvorac Microsoft Dot NET Framework Forms 0 20th Aug 2003 09:37 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:50 AM.