API Reference
Command
ConvertTo-OfficeWordHtml
Converts a Word document to HTML.
Remarks
Converts a Word document to HTML.
Examples
Convert a .docx file to HTML text.
PS>$html = ConvertTo-OfficeWordHtml -Path .\report.docx
Loads the document and returns HTML markup.
Save HTML to disk.
PS>ConvertTo-OfficeWordHtml -Path .\report.docx -OutputPath .\report.html -PassThru
Writes report.html and returns the file info.
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
ConvertTo-OfficeWordHtml [-ExcludeFootnotes] -FilePath <String> [-FontFamily <String>] [-IncludeDefaultCss] [-IncludeFontStyles] [-IncludeListStyles] [-IncludeParagraphClasses] [-IncludeRunClasses] [-OutputPath <String>] [-PassThru] [-UseImagePaths] [<CommonParameters>]#Parameter set:
PathParameters
- ExcludeFootnotes SwitchParameter
- Exclude footnotes from the HTML output.
- FilePath String
- Path to a .docx file.
- FontFamily String
- Optional font family to use during conversion.
- IncludeDefaultCss SwitchParameter
- Include the built-in default CSS in the HTML head.
- IncludeFontStyles SwitchParameter
- Include font styles as inline CSS.
- IncludeListStyles SwitchParameter
- Include list style metadata.
- IncludeParagraphClasses SwitchParameter
- Emit paragraph styles as CSS classes.
- IncludeRunClasses SwitchParameter
- Emit run styles as CSS classes.
- OutputPath String
- Optional output path for the HTML file.
- PassThru SwitchParameter
- Emit a FileInfo when saving to disk.
- UseImagePaths SwitchParameter
- Store image references as file paths instead of base64 data URIs.
Outputs
System.String System.IO.FileInfo
ConvertTo-OfficeWordHtml -Document <WordDocument> [-ExcludeFootnotes] [-FontFamily <String>] [-IncludeDefaultCss] [-IncludeFontStyles] [-IncludeListStyles] [-IncludeParagraphClasses] [-IncludeRunClasses] [-OutputPath <String>] [-PassThru] [-UseImagePaths] [<CommonParameters>]#Parameter set:
DocumentParameters
- Document WordDocument
- Word document instance to convert.
- ExcludeFootnotes SwitchParameter
- Exclude footnotes from the HTML output.
- FontFamily String
- Optional font family to use during conversion.
- IncludeDefaultCss SwitchParameter
- Include the built-in default CSS in the HTML head.
- IncludeFontStyles SwitchParameter
- Include font styles as inline CSS.
- IncludeListStyles SwitchParameter
- Include list style metadata.
- IncludeParagraphClasses SwitchParameter
- Emit paragraph styles as CSS classes.
- IncludeRunClasses SwitchParameter
- Emit run styles as CSS classes.
- OutputPath String
- Optional output path for the HTML file.
- PassThru SwitchParameter
- Emit a FileInfo when saving to disk.
- UseImagePaths SwitchParameter
- Store image references as file paths instead of base64 data URIs.
Outputs
System.String System.IO.FileInfo