Hello,

My Outlook VBA code causes a UserForm to pop up at specified times during the day (triggered by the reminders). When it does, the user needs to take action or may close it, depending on the information displayed on that UserForm.

I need to have the possibility to navigate through Outlook while UserForm is still visible. I made it happen by setting ShowModal = False - it's done by one of the buttons (I did not set it straight away in the user form settings as it is important to get user's attention by blocking the application).

Now, there are 2 scenarios:
  • The moment the form pops up, the user is at the main pane (where are all emails, folders). If the form pops up there, user can unfreeze it with button (change of modality setting), then create new email, then send that email (or close or save) and the pop up will still be there in the main pane, waiting to be closed by the different button. This scenario works fine.
  • The moment the form pops up, the user is at the mail view (either writing new email, or just looking at one opened). Then if the pop up shows in that view and user closes that email or sends it, pop up disappears as well.

I would like to achieve either of the two:
a) The pop us shows up always in the main pane, regardless of the current view of the user (he will see it once he goes to the main pane if he's in the middle of writing the email). I think it can conflict with modality set to true at the beginning.
b) The UserForm stays visible regardless if email view is closed (or as long as given button is not clicked).

Could anyone help?

I think the solution may be related to UserForm_QueryClose, as when window view is closed (email sent or closed), this QueryClose is trigerred.

Currently I have the following coder there:
Please Login or Register  to view this content.
I've tried different combinations of Show/Hide properties, however UserForm still closes and is not visible after mail view is closed, even though I receive the msgbox trigerred by that closure.

I have also tried to use ResultsForm.CommandButton1.SetFocus to regain view of the UserForm once Outlook email window is closed, however it does not work.