OfficeIMO

API Reference

Command

ConvertFrom-OfficeWordHtml

Namespace PSWriteOffice
Inputs
System.String
Outputs
OfficeIMO.Word.WordDocument System.IO.FileInfo

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: Html

Parameters

BasePath String optionalposition: namedpipeline: False
Base path used to resolve relative resources (for example images).
ContinueNumbering SwitchParameter optionalposition: namedpipeline: False
Continue numbering across separate ordered lists.
FontFamily String optionalposition: namedpipeline: False
Optional font family to apply during conversion.
Html String requiredposition: 0pipeline: True (ByValue)
HTML markup to convert.
IncludeListStyles SwitchParameter optionalposition: namedpipeline: False
Include list style metadata.
Open SwitchParameter optionalposition: namedpipeline: False
Open the document after saving.
OutputPath String optionalposition: namedpipeline: Falsealiases: OutPath
Optional output path for the .docx file.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit a FileInfo when saving to disk.
RenderPreAsTable SwitchParameter optionalposition: namedpipeline: False
Render <pre> elements as single-cell tables.
SectionTagHandling Nullable`1 optionalposition: namedpipeline: False
Controls how <section> tags are mapped into Word.
StylesheetContent String[] optionalposition: namedpipeline: False
Inline CSS stylesheets to apply during conversion.
StylesheetPath String[] optionalposition: namedpipeline: False
Paths to CSS stylesheets to apply during conversion.
SupportsHeadingNumbering SwitchParameter optionalposition: namedpipeline: False
Convert headings into a numbered list.
TableCaptionPosition Nullable`1 optionalposition: namedpipeline: False
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: Path

Parameters

BasePath String optionalposition: namedpipeline: False
Base path used to resolve relative resources (for example images).
ContinueNumbering SwitchParameter optionalposition: namedpipeline: False
Continue numbering across separate ordered lists.
FilePath String requiredposition: 0pipeline: Falsealiases: Path
Path to an HTML file.
FontFamily String optionalposition: namedpipeline: False
Optional font family to apply during conversion.
IncludeListStyles SwitchParameter optionalposition: namedpipeline: False
Include list style metadata.
Open SwitchParameter optionalposition: namedpipeline: False
Open the document after saving.
OutputPath String optionalposition: namedpipeline: Falsealiases: OutPath
Optional output path for the .docx file.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit a FileInfo when saving to disk.
RenderPreAsTable SwitchParameter optionalposition: namedpipeline: False
Render <pre> elements as single-cell tables.
SectionTagHandling Nullable`1 optionalposition: namedpipeline: False
Controls how <section> tags are mapped into Word.
StylesheetContent String[] optionalposition: namedpipeline: False
Inline CSS stylesheets to apply during conversion.
StylesheetPath String[] optionalposition: namedpipeline: False
Paths to CSS stylesheets to apply during conversion.
SupportsHeadingNumbering SwitchParameter optionalposition: namedpipeline: False
Convert headings into a numbered list.
TableCaptionPosition Nullable`1 optionalposition: namedpipeline: False
Controls where table captions are emitted.

Outputs

OfficeIMO.Word.WordDocument System.IO.FileInfo