RPA.Word.Application

Close the active document and app (if open).

Arguments

ArgumentTypeDefault value
save_changesboolFalse
param save_changes:Enable changes saving on quit. (False by default)

Copy current text selection to clipboard.

Create new document for Word application

Export active document into PDF file.

Arguments

ArgumentTypeDefault value
filenamestrnull
param filename:PDF to export WORD into

Find text in the document.

Arguments

ArgumentTypeDefault value
textstrnull
cursor_positionCursorPositionNO_MOVE
copyboolFalse
param text:text to find
param cursor_position:where to move cursor after finding text
param copy:copy found text into clipboard
raises AssertionError:if text is not found

Get all texts from active document

return:texts

Get the text of the current line in the document.

Get the number of lines in the document.

Move cursor horizontally from current cursor position.

Arguments

ArgumentTypeDefault value
charactersint0

Remember that if cursor is already at the start the cursor can't move left and if cursor is already at the end the cursor can't move right.

param characters:characters to move

Move cursor to the end of the document.

Move cursor to end of the line on the current cursor position.

Move cursor to start of the line on the current cursor position.

Move cursor to the top of the document.

Move cursor vertically from current cursor position.

Arguments

ArgumentTypeDefault value
linesint0

Remember that if cursor is already at the top the cursor can't move up and if cursor is already at the bottom the cursor can't move down.

param lines:lines to move

Open the application.

Arguments

ArgumentTypeDefault value
visibleboolFalse
display_alertsboolFalse
param visible:Show the window on opening. (False by default)
param display_alerts:Display alert popups. (False by default)

Open Word document with filename.

Arguments

ArgumentTypeDefault value
filenamestrnull
read_onlyboolTrue
param filename:Word document path

Paste content from clipboard to the document's current cursor position.

Quit the application.

Arguments

ArgumentTypeDefault value
save_changesboolFalse
param save_changes:Enable to save changes on quit. (False by default)

Replace text in active document

Arguments

ArgumentTypeDefault value
findstrnull
replacestrnull
param find:text to replace
param replace:new text

Save active document

Save document with filename and optionally with given fileformat

Arguments

ArgumentTypeDefault value
filenamestrnull
fileformatstr, NoneNone
param filename:where to save document
param fileformat:see @FILEFORMATS dictionary for possible format, defaults to None

Select text in current active paragraph.

Select paragraph(s) from current cursor position.

Arguments

ArgumentTypeDefault value
countint1

Negative count moves cursor up number of paragraphs and positive count moves cursor down number of paragraphs.

param count:number of paragraphs to select

Set header for the active document

Arguments

ArgumentTypeDefault value
textstrnull
param text:header text to set

Set the property of any object.

Arguments

ArgumentTypeDefault value
object_instancenull
property_namestrnull
valuestrnull

This is a utility keyword for Robot Framework syntax to set object property values.

${new_value}= Replace String ${value} 10.132. 5511.11. Set Object Property ${result} Value ${new_value}
param object_instance:object instance to set the property
param property_name:property name to set
param value:value to set

Writes given text at the end of the document

Arguments

ArgumentTypeDefault value
textstrnull
cursor_positionCursorPositionNO_MOVE
end_of_textboolTrue
param text:string to write
param cursor_position:where to move cursor before writing
param end_of_text:if True moves cursor to the end of the text before writing