Highlight Message

jstevens
GoldLounger
Posts: 2632
Joined: 26 Jan 2010, 16:31
Location: Southern California

Highlight Message

Post by jstevens »

Is it possible to highlight i.e. select an email message based on the ItemID? I know how to display or delete a message based on the ItemID.

Example code:

Code: Select all

Set olApp = GetObject(Class:="Outlook.Application")
Set olNsp = olApp.GetNamespace("MAPI")

 ' Get the StoreID, which is a property of the folder.
    StoreID = olScr.StoreID

Set olItm = olNsp.GetItemFromID(ItemID, StoreID)
'Something like......            
            olItm.Select
Regards,
John

User avatar
HansV
Administrator
Posts: 78857
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Highlight Message

Post by HansV »

Try

olApp.ActiveExplorer.AddToSelection olItm
Best wishes,
Hans

jstevens
GoldLounger
Posts: 2632
Joined: 26 Jan 2010, 16:31
Location: Southern California

Re: Highlight Message

Post by jstevens »

Hans,

I was able to add the Item successfully.
Regards,
John