(Solved) – How to make Outlook 365 minimize when I click close button with a Macro?

(solved)-–-how-to-make-outlook-365-minimize-when-i-click-close-button-with-a-macro?

I’m super noob of VB but I want to write a macro for Outlook 365. I’m closing my outlook all the time by mistake and I want to minimize it rather than close. When I minimize, It’s minimized to the system tray.

I found that there is a way to do that in excel but that event doesn’t exist for Outlook. Workbook_BerforeClose is working well for my purpose. At least I figured out how to disable the close button. But on Outlook most of the events are executed after closing it.

For example, this macro shows a message after Outlook is closed.

 MsgBox "Goodbye, " & Application.GetNamespace("MAPI").CurrentUser

 Cancel = True

End Sub

I also found the following one but I couldn’t run a test code with that. So I’m not sure that is it suitable for my case or not.

Thanks for reading up to here. Grateful for any kind of support.

Leave a Reply

Your email address will not be published. Required fields are marked *