Close Document

Arguments

  • save_changes: bool = False

Close the active document (if open).

Create New Document

Arguments

Create new document for Word application

Export To Pdf

Arguments

  • filename: str

Export active document into PDF file.

param filename:PDF to export WORD into

Get All Texts

Arguments

Get all texts from active document

return:texts

Open Application

Arguments

  • visible: bool = False
  • display_alerts: bool = False

Open the Word application.

param visible:show window after opening
param display_alerts:
 show alert popups

Open File

Arguments

  • filename: str = None

Open Word document with filename.

param filename:Word document filepath, defaults to None

Quit Application

Arguments

  • save_changes: bool = False

Quit the application.

Replace Text

Arguments

  • find: str
  • replace: str

Replace text in active document

param find:text to replace
param replace:new text

Save Document

Arguments

Save active document

Save Document As

Arguments

  • filename: str
  • fileformat: str = None

Save document with filename and optionally with given fileformat

param filename:where to save document
param fileformat:
 see @FILEFORMATS dictionary for possible format, defaults to None

Set Header

Arguments

  • text: str

Set header for the active document

param text:header text to set

Write Text

Arguments

  • text: str
  • newline: bool = True

Writes given text at the end of the document

param text:string to write
param newline:write text to newline if True, default to True