How to close only a specific Word document when the Word Application Scope ends and not close Word for other open documents?

I am currently testing the Word Application Scope and its activities, the only way I have found to prevent Word from closing the open document, which I use for notes (called RPA Level 1), when it closes the test document (Called Sample.docx) in my process is by running Word as the Administrator for the RPA Level 1.docx.

Is there another way inside UIPath to do this?
MaryB

@MaryB2019

Could you please tell more details about the issue ? What are you trying to achieve here ?

When word application scope ended the file will be automatically closed.

Hi Lakshman, these are the steps I performed.

  1. Open Word document “RPA Level 1.docx” - for personal notes

  2. Opened UIPath created a new project called “WordAutomation” which tested a few word activities, like Append Text, Insert Table in document called “Sample.docx”. When word opened “Sample.docx” it opened it in the same Word window as the first document and not in a separate window, which I thought. When the WordAutomation process ended successfully, closed both documents and the Word application.

  3. I then started Word, as administrator and opened the “RPA Level 1.docx”

  1. Then I reran the UIPath WordAutomation process and it opened Sample.docx in a separate window and closed only that document, which is great.

  2. I just wanted to know if there was a UIPath solution to make sure that any open documents in Word are not closed when running the UIPath Word activities. Maybe it doesn’t make any sense since this would only happen in a test environment.

I hope that’s more clear.

I was just testing the Word Automation activities, while I was taking notes in a separate Word document, and my note document was being closed when the Word Application Scope activities ended. I just wanted to keep my note document from being closed. The only way I could ensure that the Note document stayed open was to first run Word as the Administrator for that note document

1 Like

@MaryB2019 I am no expert in uipath and still trying to solve the excercises in the level 3 but I think what you are looking for is “attach window” activity, you can check the links below to see if it meets your requirements


1 Like

Hi Lakshman, the Attached Window worked great, at first the new document opened in a separate window and closed but Word for both documents closed at the end of the process. I then created a variable in the Output section for “ApplicationWindow”.

Then, I added a Close Window and in the Properties field “Use WIndow” I typed in that same variable “SavedWindow”.

Reran the process and it opened a new Word window and the sample.docx, then it close ONLY that document and window. My other document RPA Level 1 remained untouched.

Thank you so much, BTW, if you haven’t guessed I am such a beginner. LOL!

1 Like

Happy to assist my friend, You are in fact the first person I am trying to help in this forum, It feels like a great start! I’m Ruhat by the way :smiley: From what I gather, it seems like your problem is solved, if there is anything I can do to help, hit me up! If you are satisfied with the answer then I believe it is good practice to mark the thread solved so that other people can search for the same problem and encounter the solution here instead of having the same question on the forum twice. I wish you all the fun in UiPath world, hope you enjoy it as much as I do :slight_smile:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.