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

# Microsoft Word Integration: Read & Edit Documents

> Read and edit Word documents stored in OneDrive and SharePoint through the Microsoft Graph API. OAuth tokens injected automatically.

<Note>Microsoft Word is available on the Cloud plan only.</Note>

## Overview

OneCLI connects AI agents to Microsoft Word through Microsoft's OAuth flow. Agents can read, create, and edit Word documents stored in OneDrive and SharePoint. The gateway injects OAuth credentials into requests to the Microsoft Graph API automatically.

This is useful for agents working in Microsoft 365 environments that need to generate reports, draft documents, or process existing Word files.

## Setup

<Steps>
  <Step title="Go to Connections">
    Open the OneCLI dashboard and navigate to **Connections** > **Microsoft Word**.
  </Step>

  <Step title="Authorize">
    Click **Connect Microsoft Word**. You'll be redirected to Microsoft to sign in and authorize OneCLI. Review the permissions and click **Accept**.
  </Step>
</Steps>

## Permissions

| Permission      | Access       | Description                                                       |
| --------------- | ------------ | ----------------------------------------------------------------- |
| Files.ReadWrite | Read & write | View, create, update, and delete files in OneDrive and SharePoint |
| User.Read       | Read         | Your name and email address                                       |

## What agents can do

* Read the content of Word documents from OneDrive or SharePoint
* Create new Word documents
* Edit and update existing documents
* Search for documents across drives and SharePoint sites
* Access shared files and followed sites

## Controlling access with rules

Use OneCLI's [rules engine](/docs/guides/rules) to limit what agents can do with your documents. For example, you can block write operations so agents can only read documents, or restrict access to specific drives or SharePoint sites. Rules are evaluated before credential injection, so a blocked request never reaches Microsoft Graph.
