Outlook Email is minimized!! (1 Viewer)

bengiomanni

Registered User.
Local time
Today, 15:34
Joined
Mar 14, 2013
Messages
25
Outlook Email opens behind Access

I can successfully create an email with VBA code and it works great. The problem is that email only appears down below - minimized in the Taskbar. I have searched and searched but cannot find an answer to this. The SendObject command will open the email up immediately, but it does not insert my Outlook signature, so I like the other code that I found using the Outlook reference library.

This seems like it should be an easy fix, but I cannot find anything. Please help! :banghead:
 
Last edited:

pr2-eugin

Super Moderator
Local time
Today, 20:34
Joined
Nov 30, 2011
Messages
8,494
Could you give the reference to the code you found online? It might help us to look at the issue better..
 

bengiomanni

Registered User.
Local time
Today, 15:34
Joined
Mar 14, 2013
Messages
25
Re: Outlook Email opens behind Access

I just amended my title for this because I realized that the email is opening, but it opens behind Access. I would like for it to open on top of Access and I can't figure that out. Here is the code I am using.

Code:
Public Function SendEmailDisplayOutlook(MsgTo As String)
 
 
' Get Outlook using the "New" keyword
Dim olApp As New Outlook.Application
Dim olMailItem As Outlook.MailItem
 
 
'Set olApp = CreateObject("Outlook.Application")
' Create a new email object
Set olMailItem = olApp.CreateItem(0)
' Add the To/Subject/Body/Attachments to the message then display the message
With olMailItem
.To = MsgTo
.Display
End With
 
Set olApp = Nothing
Set olMailItem = Nothing
 
 
End Function
 

pr2-eugin

Super Moderator
Local time
Today, 20:34
Joined
Nov 30, 2011
Messages
8,494
Does your calling function have something like a MessageBox that involved user interaction? If so, your reason for the Access window focus.. I cannot think another way Access will take control.. As Outlook would come up with a Security Warning, which should get the focus again.. :confused:
 

bengiomanni

Registered User.
Local time
Today, 15:34
Joined
Mar 14, 2013
Messages
25
Sorry for my long delay in responding. I am off and on with these Access projects right now (sometimes VERY off for a while).

There isn't anything that involves user interaction in the call method, except for the fact that the code is in the OnClick event of a textbox on a form. Is that the issue?
 

Users who are viewing this thread

Top Bottom