[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 845
  • Last Modified:

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!
0
tracknut1
Asked:
tracknut1
  • 4
  • 4
1 Solution
 
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
 
David LeeCommented:
How are you flagging the emails now?
0
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

 
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
 
David LeeCommented:
That is odd.  Glad you have a solution and thanks for sharing it.
0
 
tracknut1Author Commented:
go figure
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now