The Word package provides actions such as Open, Find and replace text, Insert text, Read text, Save, and Close.

In this example, consider a scenario where the sales team in your organization creates proposals by copying a template, updating customer details, tailoring a product section, and saving the final document to a customer-specific folder. The entire process can take considerable time and might lead to formatting inconsistencies.

You can use these actions in the Word package to automate the repetitive tasks such as opening a template, replacing placeholders, inserting sections, validating content, and saving the document using a standardized name before closing it. Some of the benefits are:

  • The proposals are generated much faster.
  • A single template and style across all proposals ensures consistency.
  • Automated validations reduce human errors.

Prerequisites

  • A proposal template in Microsoft Word document with placeholders.

    For example:CustomerName, ProposalDate, SolutionOverview.

  • An output folder where the Word document will be automatically saved.
  • Some user defined variables such as:
    • vWordSession (String): Holds your Word session name.

      For example, SalesWordSession.

    • vTemplatePath (String): Holds the full path to the Word template
    • vCustomerName (String)
    • vProposalDate (String)
    • vSolutionOverview (String)
    • vOutputFullPath (String): Full path for the final file.

      For example, C:\Proposals\Auto_2025-09-19.docx.

    • nReplaceCount (Number): Stores how many replacements occurred (for validation)

Procedure

  1. Drag and drop the Create document action.
  2. Use the Create word session to create a session name as vWordSession for the Word document.
  3. Use the Find and replace text action to add the following placeholders:
    • Find text: CustomerName
    • Replace with: vCustomerName

      Ensure that you select All occurrences.

    • Assign count to variable: nReplaceCount

    Repeat the above instructions for ProposalDate and SolutionOverview.

    Note: The Find and replace text action can search entire document or scoped ranges. It supports case sensitivity and lets you capture the number of matches to a variable.
  4. Add the Insert text action to append a a custom cover note at the end of the document.
  5. In the Read text action, use the Paragraph index field to review a paragraph from the Word document.
    For example, executive summary. Check if this contains the customer name or date.
  6. Use the Save action to save the Word document.
  7. Use the Close action to close the document and end the session.