Pop up Outlook window using excel

Tonysdilemma

New Member
Joined
Aug 2, 2020
Messages
30
Office Version
  1. 2016
Platform
  1. Windows
Hi have following module that uses Outlook

Sub Send_Pic()
Dim OutApp As Object
Dim OutMail As Object
Dim StrBody As String
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)

StrBody = "<BODY style = font-size:14pts, font-family:Arial>" & _
"Dear Resident, <p> There is a parcel ready for collection<br>" & _
"It can be picked up from concierge<br>" & _
"<br>Kind Regards<br>"

On Error Resume Next
With OutMail
.to = Range("H3").Value
.CC = ""
.BCC = ""
.Subject = "Parcel ready for collection " & Format(Date, "dd/mm/yyyy")
.Display
.HTMLBody = StrBody & _
"<img src='C:\Users\*******\Desktop\bla\Hyde Logo.jpg' height='10%'> " & _
.HTMLBody
End With
On Error GoTo 0

Set OutMail = Nothing
Set OutApp = Nothing


End Sub

What I would like to happen is before email is sent, that it could POP UP so I can edit email if need be. Currently when I run the module, Outlook flickers on the taskbar to let me know that an email is ready to be sent.
Any suggestions on how the email can pop up before it is sent?
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Hi [U]Tonysdilemma,[/U]

Is the above the full code? I'll tell you why I'm asking it only displays for me without sending so this is probably a setting somewhere if the code is complete. You could also try moving the .Display to between the .HTMLBody and End With to see the full message.

You would normally have .send in there to have it go without reviewing
 
Upvote 0
Hi [U]Tonysdilemma,[/U]

Is the above the full code? I'll tell you why I'm asking it only displays for me without sending so this is probably a setting somewhere if the code is complete. You could also try moving the .Display to between the .HTMLBody and End With to see the full message.

You would normally have .send in there to have it go without reviewing

Hi Lee J
Yes it is complete code. I have .display rather than .send only because i may need to amend email before sending. I tried what you suggested same thing happens. Alerts me on taskbar rather than display as pop up window.
 
Upvote 0
When you say alerts/flickers has it sent or is it just minimised?
 
Upvote 0
Aha, then use this under your other End With

VBA Code:
  With GetObject(, "Outlook.Application")
    .ActiveWindow.WindowState = 0
  End With
 
Upvote 0

Forum statistics

Threads
1,214,601
Messages
6,120,465
Members
448,965
Latest member
grijken

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top