Outlook Email is minimized!!

bengiomanni

Registered User.
Local time
Today, 15:11
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:
Could you give the reference to the code you found online? It might help us to look at the issue better..
 
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
 
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:
 
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

Back
Top Bottom