Issue with - many word files open

I’m experience an issue in my robot process.
Some time the proces is not closing Word file correctly and then its continue to next transaction item and open the new Word file for that person while the first word file is still open.

Issue is that it has send wrong word file to another person.

I’m trying to check through Element exist… how many files are open…

<uia cls='MSTaskListWClass' name='Programs, that are running' />
<uia automationid='Microsoft.Office.WINWORD.EXE.15' name='Word- 2 open windows' role='menuitem' />

I tried to out Name in variable with name strCheckHowManyWordFilesOpen …like that…

<uia automationid='Microsoft.Office.WINWORD.EXE.15' name='{{strCheckHowManyWordFilesOpen}}' role='menuitem' />

It works only when 2 files are open … but if 1 file is open then this is giving error.

Can someone help on how to solv this. Thanks

Hi @Ellen

After every transaction close the word application by Kill Process activity.
In Kill Process activity give WINWORD.EXE in Process name.

Then it will close the word application for every transaction then new word file will open for the further transactions.

Check the below image for better understanding,

Hope it helps!!

We have this in process and it has still given us GDPR issue.

My question is how to verify that how many word files are open…

The selector has “name=‘Word- 2 open windows’” but when i put this in variable and remove the default value then the selector is not working…
And when dont remove the default value then its not changing the variable value ,

like if only 1 file open then it still says 2 files open. - which is wrong.

Hey @Ellen
to verify that how many word files are open you can try use powershell script:

    $wordApp = [Runtime.InteropServices.Marshal]::GetActiveObject("Word.Application")
    $docCount = $wordApp.Documents.Count
    Write-Output $docCount

1 Like