Close outlook window

How to close a particular outlook window that UiPath opened?

Kill process would close all the outlook windows open, which is not what I need. Similarly how to close a particular Chrome window that UiPath opened?

Many Thanks,


Use Attach Window activity to indicate that outlook window and create one variable to it. And then use Close Window activity and pass that window variable to close the particular window.

hi @A_Learner

you can use the use app/browser activity and specify the follow in the properties

close propertie select always, and open select never, this would work


Using classic activities. Not using modern activities. Thank you.

If I do attach window - Do I need to move all related activities I am doing into attach window? That is significant re-write. Thanks

you can use attach window or browser

and create your element (browser or window) variable to close it later using the close tab, or close window and past the variable





Thank you @fernando_zuluaga
I did not use attach window initially. If I use attach window now, do I have to move all related activities into Do block of attach window?


@A_Learner you need not to move all the related activities inside attach window since its just closing the outlook window

not really, it will work like the modern experiencie, after your end your process in your window, you can simply attacht it to know which is the window you will need to close, and the use the close window acitivity

basicly attach window and then use the close window, once your end performing your taks

@A_Learner check the below screenshot


Another Approach : Simply use close window


Thank you so much! For some reason, using the above technique is closing all outlook. For now, I am ignoring left open windows. Thanks every one for your help on this. Best,

1 Like

You can just give the selector to Close Window.

If it’s closing all Outlook windows, it’s probably closing the main Outlook window because you don’t have the selector correct.


If you are doing multiple actions in a single window then it’s good to use Attach Window (For Desktop applications) or Attach Browser(For web applications) activities and keep all activities inside that container.

@postwick That is true. But how do I distinguish between different Outlooks.

Thank you, @lakshman

With the selector. Use Ui Explorer to get a selector for the window you want to close, and post it here so we can help tweak it.

I am using “OpenApplication” activitiy. In the properties for Application Window - using a variable “w1”. After processing I am using “Close Window” activitiy and passing “w1”. This seems to be working. Is this okay to do this way or no? Thanks a lot,

1 Like

yep, that is the main purpose of those properties, alow us to identify which window we will close

Thanks! @fernando_zuluaga