Support Portal

for ProcessRobot and WinAutomation

Start a new topic
Answered

Saving word document

Hello all,

I have replaced a word in a Word Document using Process Robot but i don't know how to save it as i don't find any direct action for that. so please help me with this issue


Best Answer

Hello Jenice,


There's no direct way to Save As a word document (Word group of actions are currently being considered to be added in a future release). What you could do however, would be something similar to the following actions:


Send Keys: F12 key (opens the Save as window)

Wait for the Window: "Save As" to open

Send Keys: input the name of the file and it's path (by default the filename text field is already selected), followed by an {Enter}

At this point, depending on your process's logic you may add an option to replace the file, in case the "file already exists" message appears. This can be implemented by adding:


Wait for Window: - Capture a control of the Replace window, enable the option Fail if window does not appear within eg. 1 seconds, set the exception handling tab to Continue Process Execution to "Go to next action".

If Window: is open (specify the replace file notification window) and

Click Element in Window: to press the OK button.


Hope this helps.


ADMIN
Answer

Hello Jenice,


There's no direct way to Save As a word document (Word group of actions are currently being considered to be added in a future release). What you could do however, would be something similar to the following actions:


Send Keys: F12 key (opens the Save as window)

Wait for the Window: "Save As" to open

Send Keys: input the name of the file and it's path (by default the filename text field is already selected), followed by an {Enter}

At this point, depending on your process's logic you may add an option to replace the file, in case the "file already exists" message appears. This can be implemented by adding:


Wait for Window: - Capture a control of the Replace window, enable the option Fail if window does not appear within eg. 1 seconds, set the exception handling tab to Continue Process Execution to "Go to next action".

If Window: is open (specify the replace file notification window) and

Click Element in Window: to press the OK button.


Hope this helps.


1 person likes this

Thank You so Much



Hello Michalis,


Please let me know how to make changes in VBSript. Because for now i accessing the Word Document With VBScript. 

ADMIN

Using VBScript you can save the Word Document you are accessing by adding a property .SaveAs ("The path of the file to be saved") to the object that contains the assigned Word Document Object for example:


For example, if you are opening the document with:

Set WordDoc = Word.Documents.open("%SelectedFile%")


then to save the file as you can use the following:

WordDoc.SaveAs("C:\Users\Michalis\Desktop\WordDocument.docx")


Finally, you can also review the following article as an example for accessing a Word document using VBscript:

Read text from Word document using VBScript



1 person likes this

Thank You so much for the timely-help.

Login or Signup to post a comment