Create msgbox to confirm before Outlook closes

zoso

Well-known Member
Joined
Oct 23, 2003
Messages
725
Hi there!

I have the following code:
Code:
Private Sub Application_Quit()
    Dim Response As Integer
    Dim Title As String
    Dim Message As String

   Title = "Confirm"
   Message = "Do you really want to quit Outlook?"
   Response = MsgBox(Message, vbYesNo, Title)
   If Response = vbNo Then
       ???????????????
   End If
End Sub
What I'm after is some code in place of the ???????? so that Outlook remains open.

Hope you can help - and thanks!
 
Sorry, I thought you understood from one of my earlier posts when I did this ..

firefytr said:
In ThisOutlookSession paste:


<font face=Tahoma New><SPAN style="color:#00007F">Option</SPAN> <SPAN style="color:#00007F">Explicit</SPAN>

<SPAN style="color:#00007F">Private</SPAN> <SPAN style="color:#00007F">Sub</SPAN> Application_Startup()

<SPAN style="color:#00007F">Call</SPAN> DisableExit
<SPAN style="color:#00007F">Call</SPAN> CreateMenu

<SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN></FONT>

But you did get it working, beautiful. :)
 
Upvote 0

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

Forum statistics

Threads
1,224,856
Messages
6,181,427
Members
453,040
Latest member
Santero

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