# ConvertTo-OfficeWordMarkdown

Converts a Word document to Markdown. Review available syntax, parameters, pipeline guidance, and reference details in PSWriteOffice API Reference.

Project

PSWriteOffice

PowerShell document automation across OfficeIMO's document, spreadsheet, presentation, PDF, Project, Access, EPUB, invoicing, and conversion engines.

[View on GitHub](https://github.com/EvotecIT/OfficeIMO/tree/master/PowerShell/PSWriteOffice) [Visit Website](#) [Releases](https://github.com/EvotecIT/PSWriteOffice/releases/tag/v3.0.5) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/PSWriteOffice/0.2.0)

Stars **725**

Forks **84**

Open issues **4**

Total downloads **5,250,223**

Release **OfficeIMO-v3.6.2**

Language: C# Updated: 2026-11-24

Cmdlet 

Aliases: ConvertTo-WordMarkdown

**Module**

`PSWriteOffice`

**Aliases**

`ConvertTo-WordMarkdown`

**Inputs**

`OfficeIMO.Word.WordDocument`

**Outputs**

`System.String` `System.IO.FileInfo`

**Source**

[ConvertToOfficeWordMarkdownCommand.cs:27](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Word/ConvertToOfficeWordMarkdownCommand.cs#L27) 

Converts a Word document to Markdown.

## Syntax

```
ConvertTo-OfficeWordMarkdown
[-EnableHighlight]
[-EnableUnderline]
[-FontFamily <String>]
[-ImageDirectory <String>]
[-ImageExportMode <Base64|File>]
[-OutputPath <String>]
[-PassThru]
[-Path] <String>
[<CommonParameters>]
```

[#](#method-convertto-officewordmarkdown-switchparameter-switchparameter-string-string-imageexportmode-string-switchparameter-string)

Parameter set: `Path`

```
ConvertTo-OfficeWordMarkdown
-Document <WordDocument>
[-EnableHighlight]
[-EnableUnderline]
[-FontFamily <String>]
[-ImageDirectory <String>]
[-ImageExportMode <Base64|File>]
[-OutputPath <String>]
[-PassThru]
[<CommonParameters>]
```

[#](#method-convertto-officewordmarkdown-worddocument-switchparameter-switchparameter-string-string-imageexportmode-string-switchparameter)

Parameter set: `Document`

## Description

Returns Markdown text or saves it to a file when -OutputPath is specified.

## Examples

### Convert a .docx file to Markdown text.

```powershell
$markdown = ConvertTo-OfficeWordMarkdown -Path .\report.docx
```

Loads the document and returns Markdown markup.

### Save Markdown to disk.

```powershell
ConvertTo-OfficeWordMarkdown -Path .\report.docx -OutputPath .\report.md -PassThru
```

Writes report.md and returns the file info.

## Parameters

**-EnableHighlight SwitchParameter optional**

Wrap highlighted text with Markdown highlight markers.

**-EnableUnderline SwitchParameter optional**

Wrap underlined text with HTML underline tags.

**-FontFamily String optional**

Optional font family that should be treated as inline code.

**-ImageDirectory String optional**

Directory used when exporting images as files.

**-ImageExportMode ImageExportMode optional**

Controls how images are emitted during Markdown conversion.

Possible values: `Base64`, `File`

**-OutputPath String optionalaliases: OutPath**

Optional output path for the Markdown file.

**-PassThru SwitchParameter optional**

Emit a FileInfo when saving to disk.

**-Path String requiredposition: 0aliases: FilePathsets: Path**

Path to a .docx file.

**-Document WordDocument requiredpipeline: True (ByValue)sets: Document**

Word document instance to convert.

## Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see [about_CommonParameters](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

Evotec API Reference Copyright 2026 Evotec Services

<!-- PowerForge markdown artifact sha256:18072ED1C0ACD49A19754F5B3DE446884D27A02B8D87F51BAE46E897B5E46999 -->
