# ConvertFrom-OfficeWordHtml

Creates a Word document from 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 **725**

Forks **84**

Open issues **3**

Total downloads **5,231,343**

Release **OfficeIMO-v3.6.2**

Language: C# Updated: 2026-11-23

Cmdlet 

Aliases: ConvertFrom-WordHtml

**Module**

`PSWriteOffice`

**Aliases**

`ConvertFrom-WordHtml`

**Inputs**

`System.String`

**Outputs**

`OfficeIMO.Word.WordDocument` `System.IO.FileInfo`

**Source**

[ConvertFromOfficeWordHtmlCommand.cs:28](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Word/ConvertFromOfficeWordHtmlCommand.cs#L28) 

Creates a Word document from HTML.

## Syntax

```
ConvertFrom-OfficeWordHtml
[-BasePath <String>]
[-ContinueNumbering]
[-FontFamily <String>]
[-Html] <String>
[-IncludeListStyles]
[-Open]
[-OutputPath <String>]
[-PassThru]
[-RenderPreAsTable]
[-SectionTagHandling <WordSection|Block>]
[-StylesheetContent <String[]>]
[-StylesheetPath <String[]>]
[-SupportsHeadingNumbering]
[-TableCaptionPosition <Above|Below>]
[<CommonParameters>]
```

[#](#member-a21c0131c8b024682e2ab8fe)

Parameter set: `Html`

```
ConvertFrom-OfficeWordHtml
[-BasePath <String>]
[-ContinueNumbering]
[-FontFamily <String>]
[-IncludeListStyles]
[-Open]
[-OutputPath <String>]
[-PassThru]
[-Path] <String>
[-RenderPreAsTable]
[-SectionTagHandling <WordSection|Block>]
[-StylesheetContent <String[]>]
[-StylesheetPath <String[]>]
[-SupportsHeadingNumbering]
[-TableCaptionPosition <Above|Below>]
[<CommonParameters>]
```

[#](#member-61efb3481f309743dce379da)

Parameter set: `Path`

## Description

Returns a WordDocument or saves it to disk when -OutputPath is provided.

## Examples

### Create a .docx from HTML markup.

```powershell
ConvertFrom-OfficeWordHtml -Html '<h1>Hello</h1>' -OutputPath .\hello.docx
```

Writes a Word document containing the supplied HTML.

### Load HTML from disk and get the document object.

```powershell
$doc = ConvertFrom-OfficeWordHtml -Path .\snippet.html
```

Returns a Word document instance for further edits.

## Parameters

**-BasePath String optional**

Base path used to resolve relative resources (for example images).

**-ContinueNumbering SwitchParameter optional**

Continue numbering across separate ordered lists.

**-FontFamily String optional**

Optional font family to apply during conversion.

**-Html String requiredposition: 0pipeline: True (ByValue)sets: Html**

HTML markup to convert.

**-IncludeListStyles SwitchParameter optional**

Include list style metadata.

**-Open SwitchParameter optional**

Open the document after saving.

**-OutputPath String optionalaliases: OutPath**

Optional output path for the .docx file.

**-PassThru SwitchParameter optional**

Emit a FileInfo when saving to disk.

**-RenderPreAsTable SwitchParameter optional**

Render <pre> elements as single-cell tables.

**-SectionTagHandling SectionTagHandling optional**

Controls how <section> tags are mapped into Word.

Possible values: `WordSection`, `Block`

**-StylesheetContent String[] optional**

Inline CSS stylesheets to apply during conversion.

**-StylesheetPath String[] optional**

Paths to CSS stylesheets to apply during conversion.

**-SupportsHeadingNumbering SwitchParameter optional**

Convert headings into a numbered list.

**-TableCaptionPosition TableCaptionPosition optional**

Controls where table captions are emitted.

Possible values: `Above`, `Below`

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

Path to an HTML file.

## 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:B9F72619A7CF73A4195533245C1B358AB309634F69FE23853B83B57364EB8CCC -->
