Set focus to a specific Inbox Email

I am looking for a way to set focus on a specific email in my Outlook 2003 inbox from Access (2003).
I have the MailItem.EntryID available.

The following code, borrowed from the this website, is good for moving focus focus to the outlook inbox.]
I just want to aded the further step of going to / setting focus on a specific email.

Thanks for any help!
tracknut1Asked:
Who is Participating?
 
David LeeCommented:
That is odd.  Glad you have a solution and thanks for sharing it.
0
 
David LeeCommented:
Hi, tracknut1.

Unfortunately that's not possible.  Outlook's object model doesn't provide a method of selecting a message in an explorer window.  The closest you can come is to tinker with using SendKeys to send up/down arrow commands, then check the currently selected item to see if it's the one you want.

You can open a particular item though.  Would that work?
0
 
tracknut1Author Commented:
My main problem is with flagging specific emails items.
***What I am doing:
*I have a Tree View control inside of my Access DB (2003)
*The Tree View control displays records called issues.
*By dragging email item(s) from outlook I save portions of the text of the email to the access record.
*I then flag the actual outlook email to mark it as "filed".

***My problem
*Email items do not consistantly flag.
*I was hoping that by navigating to the actual email I might be able to get around this.
(I know, kludgey)

I might have to find another way to distinguish an Outlook email as "filed".

0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
David LeeCommented:
How are you flagging the emails now?
0
 
tracknut1Author Commented:
Sub Set_Email_Flag()
   
    currentMail.Body = "#### EMAIL FILED TO COLLAGE to " & EmProjCode & "  " & EmObjectType & "  >>>" & EmObjectName & "<<< ####" & Chr(13) & "______________________________________" & Chr(13) & Chr(13) & currentMail.Body
    currentMail.FlagStatus = olFlagMarked
    If EmObjectType = "Issue" Then
        currentMail.FlagIcon = olRedFlagIcon
    ElseIf EmObjectType = "Task" Then
        currentMail.FlagIcon = olRedFlagIcon
    End If
   
' double pump it

    currentMail.Save
    currentMail.Save
   
End Sub
0
 
David LeeCommented:
The code looks good.  I tested it to make sure and it flags the message every time for me.  Have you tried setting a breakpoint in the debugger to see what's happening?  If is possible that the items which aren't being flagged don't have the correct EmObjectType?
0
 
tracknut1Author Commented:
Solution!! And I dont know why....
Running a save after each action resolves the problem with inconsistancy in flagging.
Go figure
0
 
tracknut1Author Commented:
go figure
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.