API Reference
Command
ConvertFrom-OfficeWordHtml
Creates a Word document from HTML.
Remarks
Creates a Word document from HTML.
Examples
Create a .docx from HTML markup.
PS>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.
PS>$doc = ConvertFrom-OfficeWordHtml -Path .\snippet.html
Returns a Word document instance for further edits.
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.
Syntax
ConvertFrom-OfficeWordHtml [-BasePath <String>] [-ContinueNumbering] [-FontFamily <String>] -Html <String> [-IncludeListStyles] [-Open] [-OutputPath <String>] [-PassThru] [-RenderPreAsTable] [-SectionTagHandling <Nullable`1>] [-StylesheetContent <String[]>] [-StylesheetPath <String[]>] [-SupportsHeadingNumbering] [-TableCaptionPosition <Nullable`1>] [<CommonParameters>]#Parameter set:
HtmlParameters
- BasePath String
- Base path used to resolve relative resources (for example images).
- ContinueNumbering SwitchParameter
- Continue numbering across separate ordered lists.
- FontFamily String
- Optional font family to apply during conversion.
- Html String
- HTML markup to convert.
- IncludeListStyles SwitchParameter
- Include list style metadata.
- Open SwitchParameter
- Open the document after saving.
- OutputPath String
- Optional output path for the .docx file.
- PassThru SwitchParameter
- Emit a FileInfo when saving to disk.
- RenderPreAsTable SwitchParameter
- Render <pre> elements as single-cell tables.
- SectionTagHandling Nullable`1
- Controls how <section> tags are mapped into Word.
- StylesheetContent String[]
- Inline CSS stylesheets to apply during conversion.
- StylesheetPath String[]
- Paths to CSS stylesheets to apply during conversion.
- SupportsHeadingNumbering SwitchParameter
- Convert headings into a numbered list.
- TableCaptionPosition Nullable`1
- Controls where table captions are emitted.
Outputs
OfficeIMO.Word.WordDocument System.IO.FileInfo
ConvertFrom-OfficeWordHtml [-BasePath <String>] [-ContinueNumbering] -FilePath <String> [-FontFamily <String>] [-IncludeListStyles] [-Open] [-OutputPath <String>] [-PassThru] [-RenderPreAsTable] [-SectionTagHandling <Nullable`1>] [-StylesheetContent <String[]>] [-StylesheetPath <String[]>] [-SupportsHeadingNumbering] [-TableCaptionPosition <Nullable`1>] [<CommonParameters>]#Parameter set:
PathParameters
- BasePath String
- Base path used to resolve relative resources (for example images).
- ContinueNumbering SwitchParameter
- Continue numbering across separate ordered lists.
- FilePath String
- Path to an HTML file.
- FontFamily String
- Optional font family to apply during conversion.
- IncludeListStyles SwitchParameter
- Include list style metadata.
- Open SwitchParameter
- Open the document after saving.
- OutputPath String
- Optional output path for the .docx file.
- PassThru SwitchParameter
- Emit a FileInfo when saving to disk.
- RenderPreAsTable SwitchParameter
- Render <pre> elements as single-cell tables.
- SectionTagHandling Nullable`1
- Controls how <section> tags are mapped into Word.
- StylesheetContent String[]
- Inline CSS stylesheets to apply during conversion.
- StylesheetPath String[]
- Paths to CSS stylesheets to apply during conversion.
- SupportsHeadingNumbering SwitchParameter
- Convert headings into a numbered list.
- TableCaptionPosition Nullable`1
- Controls where table captions are emitted.
Outputs
OfficeIMO.Word.WordDocument System.IO.FileInfo