# ConvertTo-OfficeWordHtml

Converts a Word document to HTML. 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 **727**

Forks **84**

Open issues **7**

Total downloads **5,275,783**

Release **OfficeIMO-v3.6.2**

Language: C# Updated: 2026-11-24

Cmdlet 

Aliases: ConvertTo-WordHtml

**Module**

`PSWriteOffice`

**Aliases**

`ConvertTo-WordHtml`

**Inputs**

`OfficeIMO.Word.WordDocument`

**Outputs**

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

**Source**

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

Converts a Word document to HTML.

## Syntax

```
ConvertTo-OfficeWordHtml
[-ExcludeFootnotes]
[-FontFamily <String>]
[-IncludeDefaultCss]
[-IncludeFontStyles]
[-IncludeListStyles]
[-IncludeParagraphClasses]
[-IncludeRunClasses]
[-OutputPath <String>]
[-PassThru]
[-Path] <String>
[-UseImagePaths]
[<CommonParameters>]
```

[#](#method-convertto-officewordhtml-switchparameter-string-switchparameter-switchparameter-switchparameter-switchparameter-switchparameter-string-switchparameter-string-switchparameter)

Parameter set: `Path`

```
ConvertTo-OfficeWordHtml
-Document <WordDocument>
[-ExcludeFootnotes]
[-FontFamily <String>]
[-IncludeDefaultCss]
[-IncludeFontStyles]
[-IncludeListStyles]
[-IncludeParagraphClasses]
[-IncludeRunClasses]
[-OutputPath <String>]
[-PassThru]
[-UseImagePaths]
[<CommonParameters>]
```

[#](#method-convertto-officewordhtml-worddocument-switchparameter-string-switchparameter-switchparameter-switchparameter-switchparameter-switchparameter-string-switchparameter-switchparameter)

Parameter set: `Document`

## Description

Returns the HTML string or saves it to a file when -OutputPath is specified.

## Examples

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

```powershell
$html = ConvertTo-OfficeWordHtml -Path .\report.docx
```

Loads the document and returns HTML markup.

### Save HTML to disk.

```powershell
ConvertTo-OfficeWordHtml -Path .\report.docx -OutputPath .\report.html -PassThru
```

Writes report.html and returns the file info.

## Parameters

**-ExcludeFootnotes SwitchParameter optional**

Exclude footnotes from the HTML output.

**-FontFamily String optional**

Optional font family to use during conversion.

**-IncludeDefaultCss SwitchParameter optional**

Include the built-in default CSS in the HTML head.

**-IncludeFontStyles SwitchParameter optional**

Include font styles as inline CSS.

**-IncludeListStyles SwitchParameter optional**

Include list style metadata.

**-IncludeParagraphClasses SwitchParameter optional**

Emit paragraph styles as CSS classes.

**-IncludeRunClasses SwitchParameter optional**

Emit run styles as CSS classes.

**-OutputPath String optionalaliases: OutPath**

Optional output path for the HTML file.

**-PassThru SwitchParameter optional**

Emit a FileInfo when saving to disk.

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

Path to a .docx file.

**-UseImagePaths SwitchParameter optional**

Store image references as file paths instead of base64 data URIs.

**-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:6C64AA82C8267B8B4E277DC6F0DE9F5F49AAD27BCA08FF450B59F91335A8CAEC -->
