Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

New-OfficeHtmlWordOptions

Module
PSWriteOffice
Inputs
None
Outputs
OfficeIMO.Word.Html.HtmlWordExportOptions

Creates native HTML-to-Word options for Convert-OfficeDocument.

Syntax

New-OfficeHtmlWordOptions
[-BasePath <String>]
[-ContinueNumbering]
[-Font <String>]
[-IncludeListStyles]
[-RenderPreAsTable]
[-SectionTagHandling <WordSection|Block>]
[-StylesheetContent <String[]>]
[-StylesheetPath <String[]>]
[-SupportsHeadingNumbering]
[-TableCaptionPosition <Above|Below>]
[<CommonParameters>]
#
Parameter set: Default

Examples

Apply an explicit stylesheet while keeping document-linked stylesheets disabled.

$options = New-OfficeHtmlWordOptions -StylesheetPath ./report.css -RenderPreAsTable
Convert-OfficeDocument -Path ./Report.html -To Word -OutputPath ./Report.docx -Options $options

Parameters

-BasePath String optional
Filesystem base folder for relative resources, without creating it.
-ContinueNumbering SwitchParameter optional
Continue numbering across imported lists.
-Font String optional
Font family for imported text.
-IncludeListStyles SwitchParameter optional
Import list style information.
-RenderPreAsTable SwitchParameter optional
Render preformatted blocks inside a single-cell table.
-SectionTagHandling WordHtmlSectionTagHandling optional
How HTML section tags map into Word.
Possible values: WordSection, Block
-StylesheetContent String[] optional
Additional CSS stylesheet text.
-StylesheetPath String[] optional
Explicit literal stylesheet files, resolved through the FileSystem provider.
-SupportsHeadingNumbering SwitchParameter optional
Allow heading numbering during import.
-TableCaptionPosition WordHtmlTableCaptionPosition optional
Position of an imported table caption.
Possible values: Above, Below

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.