RPA.Word.Application

Close the active document and app (if open).

Arguments

ArgumentTypeDefault valueDescription
save_changesboolFalseEnable changes saving on quit. (False by default)
param save_changes:
 Enable changes saving on quit. (False by default)

Create new document for Word application

Export active document into PDF file.

Arguments

ArgumentTypeDefault valueDescription
filenamestrnullPDF to export WORD into
param filename:PDF to export WORD into

Get all texts from active document

return:texts

Open the application.

Arguments

ArgumentTypeDefault valueDescription
visibleboolFalseShow the window on opening. (False by default)
display_alertsboolFalseDisplay alert popups. (False by default)
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 valueDescription
filenamestrnullWord document path
read_onlyboolTrue
param filename:Word document path

Quit the application.

Arguments

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

Replace text in active document

Arguments

ArgumentTypeDefault valueDescription
findstrnulltext to replace
replacestrnullnew text
param find:text to replace
param replace:new text

Save active document

Save document with filename and optionally with given fileformat

Arguments

ArgumentTypeDefault valueDescription
filenamestrnullwhere to save document
fileformatstr, NoneNonesee @FILEFORMATS dictionary for possible format, defaults to None
param filename:where to save document
param fileformat:
 see @FILEFORMATS dictionary for possible format, defaults to None

Set header for the active document

Arguments

ArgumentTypeDefault valueDescription
textstrnullheader text to set
param text:header text to set

Writes given text at the end of the document

Arguments

ArgumentTypeDefault valueDescription
textstrnullstring to write
newlineboolTruewrite text to newline if True, default to True
param text:string to write
param newline:write text to newline if True, default to True