I have email automation, but when it opens up the outlook screen, the outlook window has a topmost function in it and I can't go back to my program. ANy thoughts?
Dim oOutL As New Outlook.Application
Dim oMail As Outlook.MailItem
Dim oAddSig As Outlook.Inspector
oMail = oOutL.CreateItem(Outlook.OlItemType.olMailItem)
'oMail.UnRead = True
oMail.To = Me.P_emailTextBox.Text
oMail.Subject = "Blah"
'oMail.HTMLBody = True
oAddSig = oMail.GetInspector
oMail.Body = "Dear " & Me.P_titleTextBox.Text & " " & Me.P_firstTextBox.Text & " " & Me.P_lastTextBox.Text & "," & oMail.Body
oMail.Display(True)
'oMail.SendUsingAccount = "blah@blah.com"
Return
The problem is that you are displaying the outlook mail item modally (passing true to the Display
method).
If you need to work in your program, you should pass False and then set a breakpoint in your program so that you can inspect what you need to inspect.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.