OfficeIMO

API Reference

Command

ConvertTo-OfficeWordMarkdown

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

Converts a Word document to Markdown.

Remarks

Converts a Word document to Markdown.

Examples

Convert a .docx file to Markdown text.


PS>$markdown = ConvertTo-OfficeWordMarkdown -Path .\report.docx
        

Loads the document and returns Markdown markup.

Save Markdown to disk.


PS>ConvertTo-OfficeWordMarkdown -Path .\report.docx -OutputPath .\report.md -PassThru
        

Writes report.md 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-OfficeWordMarkdown [-EnableHighlight] [-EnableUnderline] -FilePath <String> [-FontFamily <String>] [-ImageDirectory <String>] [-ImageExportMode <Base64|File>] [-OutputPath <String>] [-PassThru] [<CommonParameters>]
#
Parameter set: Path

Parameters

EnableHighlight SwitchParameter optionalposition: namedpipeline: False
Wrap highlighted text with Markdown highlight markers.
EnableUnderline SwitchParameter optionalposition: namedpipeline: False
Wrap underlined text with HTML underline tags.
FilePath String requiredposition: 0pipeline: Falsealiases: Path
Path to a .docx file.
FontFamily String optionalposition: namedpipeline: False
Optional font family that should be treated as inline code.
ImageDirectory String optionalposition: namedpipeline: False
Directory used when exporting images as files.
ImageExportMode ImageExportMode optionalposition: namedpipeline: Falsevalues: 2
Controls how images are emitted during Markdown conversion.
Possible values: Base64, File
OutputPath String optionalposition: namedpipeline: Falsealiases: OutPath
Optional output path for the Markdown file.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit a FileInfo when saving to disk.

Outputs

System.String System.IO.FileInfo

ConvertTo-OfficeWordMarkdown -Document <WordDocument> [-EnableHighlight] [-EnableUnderline] [-FontFamily <String>] [-ImageDirectory <String>] [-ImageExportMode <Base64|File>] [-OutputPath <String>] [-PassThru] [<CommonParameters>]
#
Parameter set: Document

Parameters

Document WordDocument requiredposition: namedpipeline: True (ByValue)
Word document instance to convert.
EnableHighlight SwitchParameter optionalposition: namedpipeline: False
Wrap highlighted text with Markdown highlight markers.
EnableUnderline SwitchParameter optionalposition: namedpipeline: False
Wrap underlined text with HTML underline tags.
FontFamily String optionalposition: namedpipeline: False
Optional font family that should be treated as inline code.
ImageDirectory String optionalposition: namedpipeline: False
Directory used when exporting images as files.
ImageExportMode ImageExportMode optionalposition: namedpipeline: Falsevalues: 2
Controls how images are emitted during Markdown conversion.
Possible values: Base64, File
OutputPath String optionalposition: namedpipeline: Falsealiases: OutPath
Optional output path for the Markdown file.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit a FileInfo when saving to disk.

Outputs

System.String System.IO.FileInfo