Skip to main content

Open or Create Word Document

Command description

  • Open an existing file or create it if it does not exist. Existing content is not cleared.
  • Visibility controls whether Microsoft Office or WPS is shown while the workflow runs.
  • After reading or writing, use Close Word Document to release resources. Reopen the document with Open or Create Word Document before using it again.

Command Input Parameters

input parametersInput parameter typeDescription
ApplicationenumAuto, WPS, Office; use the WPS or Microsoft Office COM interface
VisibilityenumHide, Show; whether to display the application during automation
File LocationstrFile path, such as C:\xx.docx; a relative path is resolved under the current user's Documents/RPA directory

Command Output Parameters

Output parametersOutput parameter typeDescription
Word ObjectWordAppThe opened document object; use its path attribute to get the full file path
tip

This command automates Microsoft Word or Kingsoft WPS on the current computer, so one of those applications must be installed.

Example