Outlook Message Does Not Always Display From Access VBA Application

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • reko
    New Member
    • Apr 2010
    • 2

    Outlook Message Does Not Always Display From Access VBA Application

    I have an access 2007 vba application that creates and displays an email before sending. Display is done using .DISPLAY Most of the time it works as expected, the outlook message displays on the screen, the user edits and sends it, and control returns to the Access form. But, sometimes the outlook message does not pop up to the user. The user has to look around in their task bar at the bottom of the screen to find the new message. They find it there, click on it to activate it,send it, and then control returns to access form. It seems to happen randomly. Outlook is already open and it doesn't seem to matter where they were in outlook.

    Do I need to add code to activate the new mail item in addition to .display ? What would this code be? Also, if I do this, would control return to my Access application after user sends the message?
  • reko
    New Member
    • Apr 2010
    • 2

    #2
    Originally posted by reko
    I have an access 2007 vba application that creates and displays an email before sending. Display is done using .DISPLAY Most of the time it works as expected, the outlook message displays on the screen, the user edits and sends it, and control returns to the Access form. But, sometimes the outlook message does not pop up to the user. The user has to look around in their task bar at the bottom of the screen to find the new message. They find it there, click on it to activate it,send it, and then control returns to access form. It seems to happen randomly. Outlook is already open and it doesn't seem to matter where they were in outlook.

    Do I need to add code to activate the new mail item in addition to .display ? What would this code be? Also, if I do this, would control return to my Access application after user sends the message?
    problem resolved using these steps:
    1. get window handle id of outllook message window using inspector caption
    2. setforeground window using window handle id found in step 1
    3. do showwindow

    just using .activate or .display did not work - because sometimes message screen went to task bar rather than popping up

    Comment

    • Jim Doherty
      Recognized Expert Contributor
      • Aug 2007
      • 897

      #3
      Originally posted by reko
      problem resolved using these steps:
      1. get window handle id of outllook message window using inspector caption
      2. setforeground window using window handle id found in step 1
      3. do showwindow

      just using .activate or .display did not work - because sometimes message screen went to task bar rather than popping up
      At the very least can I say thankyou reko for posrting your own solution others benefit from that kind of involvement with Bytes

      Comment

      Working...