> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tryprofound.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Using Word in Agents

> Read and create Word documents with Microsoft Word Agent nodes

After you [connect Microsoft SharePoint](/integrations/microsoft-365/connect-microsoft-sharepoint-to-profound), the following nodes become available in Profound Agents under **Microsoft Suite** > **Microsoft Word**. Use them to read the text of a Word document and to create new documents in OneDrive or SharePoint.

Every node runs with the permissions of the account you select under **Microsoft Account**. A node reaches only the files that the connected account can open.

<Note>
  New to Agents? See [Getting started with Agents](https://help.tryprofound.com/articles/2212787792-create-an-agent) in the Profound Help Center.
</Note>

## Available nodes

<Tabs>
  <Tab title="Create Document" icon="file-plus">
    ### Create Document

    Creates a Word document from plain text, Markdown, or HTML.

    #### Required inputs

    * **Microsoft Account** — Select a connected account from the dropdown
    * **Title** — The document title without the file extension (the node appends `.docx` automatically). If a file with the same name already exists in the selected folder, Microsoft 365 gives the new file a numbered name, such as `Document 1`

    #### Optional inputs

    | Input                  | Default        | Description                                                                                                                                                          |
    | ---------------------- | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    | **Content format**     | **Plain text** | How to read the data in the **Initial content** field: **Plain text**, **Markdown**, or **HTML**.                                                                    |
    | **Initial content**    | Empty          | The document body, up to 1,000,000 characters. The writer keeps headings, lists, bold, italic, and links, and turns tables, code blocks, and images into plain text. |
    | **Destination folder** | OneDrive root  | The folder that the new document is saved into. Search for a folder by name, paste its link, or browse for it.                                                       |

    #### Output

    A JSON object with the saved document's reference ID, URL, title, and name. The name and title values are the ones Microsoft 365 saved. If they differ from the **Title** you entered, a file with that title already existed.

    <Tip>
      Pass `document_ref` from the output to the [**Get Document**](#get-document) node as the **Document** to read the contents of the created document.
    </Tip>
  </Tab>

  <Tab title="Get Document" icon="file-lines">
    ### Get Document

    Reads the text of a Word document.

    #### Required inputs

    * **Microsoft Account** — Select a connected account from the dropdown
    * **Document** — A `.docx` or `.docm` file. Provide it in one of the following ways:
      * **Search by name**: search reaches only the files Microsoft has indexed, so a file created a moment ago may not appear yet.
      * **Paste the SharePoint or OneDrive link** of the document.
      * **Browse** by selecting **Browse documents in OneDrive or SharePoint** at the bottom of the documents list. This opens the Microsoft file picker, which also finds files search can't show yet.
      * **Use a variable** from an earlier node's output, for example the `document_ref` that [**Create Document**](#create-document) returns.

    #### Optional inputs

    * **Export format** — **Markdown** (default) or **Plain text**. Markdown keeps headings, bullet and numbered lists, bold, italic, tables, and links. Plain text separates paragraphs with a newline and writes each table row as one line with a tab between cells.

    #### Output

    The document body as one string in the selected format. Tracked changes are applied as accepted. The output leaves out headers, footers, footnotes, endnotes, comments, and images.

    <Note>
      The node reads up to 5,000,000 characters of text from a file of up to 25 MB. A larger document fails with an error instead of returning a partial result.
    </Note>
  </Tab>
</Tabs>

## Troubleshooting

See [Troubleshooting Microsoft 365 setup and Agent errors](/integrations/microsoft-365/microsoft-365-integrations-troubleshooting) for errors the Word nodes report.
