# Microsoft Word

> Create Word documents, and find, organize, share and restore the documents in a OneDrive for Business. It can't change the text of a document that already exists.

App · 16 actions. Web page: https://docs.lodol.com/docs/integrations/microsoft-word

## Actions

### Convert document to PDF

Make a PDF of a document that later steps can use: an email can attach it, or OneDrive's Upload file can save it. The document is left as it is. Documents of up to 2 MB, Microsoft's limit for converting.

**Inputs**

- Document (`document_id`, text, required): The document's ID, from an earlier step such as List documents, Search documents or Create document.

**Outputs**

- `data` (object): Microsoft Word response data.

**Example output**

```json
{
  "data": {
    "document_ref": "example",
    "file_name": "example"
  }
}
```

### Create document

Create a new Word document, with some starting text if you like. It won't replace a document that already has the same name.

**Inputs**

- File name (`filename`, text, required): The new document's name, ending in .docx, for example Minutes.docx.
- Starting text (`text`, text): Text to put in the new document. Each line becomes a paragraph. Leave blank for an empty document.

**Outputs**

- `data` (object): Microsoft Word response data.

**Example output**

```json
{
  "data": {
    "eTag": "example",
    "file": {},
    "folder": {},
    "id": "example",
    "name": "example",
    "size": 1,
    "webUrl": "example"
  }
}
```

### Create sharing link

Create a link that lets people view or edit a document: anyone in your organization, or anyone who has the link.

**Inputs**

- Document (`document_id`, text, required): The document's ID, from an earlier step such as List documents, Search documents or Create document.
- Lets people (`type`, text, required): Whether people with the link can only read the document, or change it too. One of: `view` (View only), `edit` (Can edit).
- Who can use it (`scope`, text, required): Who the link works for: people signed in to your organization, or anyone who has it. One of: `organization` (Anyone in your organization), `anonymous` (Anyone with the link).
- Expires (`expiration_date_time`, date and time): When the link stops working. Leave blank for a link that doesn't expire.

**Outputs**

- `data` (object): Microsoft Word response data.

**Example output**

```json
{
  "data": {}
}
```

### Delete document

Delete a document. It goes to the OneDrive's recycle bin, where it can be restored for a while.

**Inputs**

- Document (`document_id`, text, required): The document's ID, from an earlier step such as List documents, Search documents or Create document.

**Outputs**

- `data` (object): Microsoft Word response data.

**Example output**

```json
{
  "data": {}
}
```

### Duplicate document

Make a copy of a document under a new name, in the same folder or another one. The copy is made in the background, so it can take a moment to appear.

**Inputs**

- Document (`document_id`, text, required): The document's ID, from an earlier step such as List documents, Search documents or Create document.
- Name of the copy (`name`, text, required): The copy's name, ending in .docx.
- Destination folder (`parent_reference`, object): The folder to put the copy in, as its id (and driveId for another drive). Leave blank to keep it beside the original.

**Outputs**

- `data` (object): Microsoft Word response data.

**Example output**

```json
{
  "data": {
    "accepted": false,
    "monitor_url": "example"
  }
}
```

### Get document

Get a document's details: its name, size and link.

**Inputs**

- Document (`document_id`, text, required): The document's ID, from an earlier step such as List documents, Search documents or Create document.

**Outputs**

- `data` (object): Microsoft Word response data.

**Example output**

```json
{
  "data": {
    "eTag": "example",
    "file": {},
    "folder": {},
    "id": "example",
    "name": "example",
    "size": 1,
    "webUrl": "example"
  }
}
```

### Get document text

Read the words in a .docx document, one paragraph to a line, for later steps such as an AI step or an email. The document isn't changed.

**Inputs**

- Document (`document_id`, text, required): The document's ID, from an earlier step such as List documents, Search documents or Create document.

**Outputs**

- `data` (object): Microsoft Word response data.

**Example output**

```json
{
  "data": {
    "id": "example",
    "name": "example",
    "text": "example",
    "truncated": false
  }
}
```

### Get document version

Get the details of one saved version of a document: when it was saved and by whom.

**Inputs**

- Document (`document_id`, text, required): The document's ID, from an earlier step such as List documents, Search documents or Create document.
- Version ID (`version_id`, text, required): The version's ID, from an earlier List document versions step.

**Outputs**

- `data` (object): Microsoft Word response data.

**Example output**

```json
{
  "data": {}
}
```

### List document permissions

List who can open a document, and its sharing links.

**Inputs**

- Document (`document_id`, text, required): The document's ID, from an earlier step such as List documents, Search documents or Create document.

**Outputs**

- `data` (object): Microsoft Word response data.

**Example output**

```json
{
  "data": {
    "value": []
  }
}
```

### List document versions

List the saved versions of a document, newest first.

**Inputs**

- Document (`document_id`, text, required): The document's ID, from an earlier step such as List documents, Search documents or Create document.

**Outputs**

- `data` (object): Microsoft Word response data.

**Example output**

```json
{
  "data": {
    "value": []
  }
}
```

### List documents

List the documents and folders at the top level of the OneDrive.

**Inputs**

- Number of results (`top`, number): How many to return at most, up to 200. From 1 to 200.
- Next page (`skiptoken`, text): Leave blank for the first page. To get the next one, use the page token from an earlier List documents step.

**Outputs**

- `data` (object): Microsoft Word response data.

**Example output**

```json
{
  "data": {
    "value": []
  }
}
```

### Move document

Move a document to another folder, renaming it on the way if you like.

**Inputs**

- Document (`document_id`, text, required): The document's ID, from an earlier step such as List documents, Search documents or Create document.
- Destination folder ID (`parent_reference_id`, text, required): The ID of the folder to move the document into.
- New name (`name`, text): A new name for the document once it's moved. Leave blank to keep its name.

**Outputs**

- `data` (object): Microsoft Word response data.

**Example output**

```json
{
  "data": {
    "eTag": "example",
    "file": {},
    "folder": {},
    "id": "example",
    "name": "example",
    "size": 1,
    "webUrl": "example"
  }
}
```

### Remove document permission

Take away a person's access to a document, or turn off one of its sharing links.

**Inputs**

- Document (`document_id`, text, required): The document's ID, from an earlier step such as List documents, Search documents or Create document.
- Permission ID (`permission_id`, text, required): The permission's ID, from an earlier List document permissions step.

**Outputs**

- `data` (object): Microsoft Word response data.

**Example output**

```json
{
  "data": {}
}
```

### Rename document

Give a document a new name.

**Inputs**

- Document (`document_id`, text, required): The document's ID, from an earlier step such as List documents, Search documents or Create document.
- New name (`name`, text, required): The document's new name, ending in .docx.

**Outputs**

- `data` (object): Microsoft Word response data.

**Example output**

```json
{
  "data": {
    "eTag": "example",
    "file": {},
    "folder": {},
    "id": "example",
    "name": "example",
    "size": 1,
    "webUrl": "example"
  }
}
```

### Restore document version

Bring a document back to one of its earlier saved versions.

**Inputs**

- Document (`document_id`, text, required): The document's ID, from an earlier step such as List documents, Search documents or Create document.
- Version ID (`version_id`, text, required): The version's ID, from an earlier List document versions step.

**Outputs**

- `data` (object): Microsoft Word response data.

**Example output**

```json
{
  "data": {}
}
```

### Search documents

Find documents whose name or text matches your search words.

**Inputs**

- Search for (`query`, text, required): Words to look for in documents' names and text.

**Outputs**

- `data` (object): Microsoft Word response data.

**Example output**

```json
{
  "data": {
    "value": []
  }
}
```
