OfficeIMO

API Reference

Command

ConvertFrom-OfficeWordMarkdown

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

Creates a Word document from Markdown.

Remarks

Creates a Word document from Markdown.

Examples

Create a .docx from Markdown text.


PS>ConvertFrom-OfficeWordMarkdown -Markdown '# Hello' -OutputPath .\hello.docx
        

Writes a Word document containing the supplied Markdown.

Pipe a Markdown document into Word conversion.


PS>Get-OfficeMarkdown -Path .\README.md | ConvertFrom-OfficeWordMarkdown
        

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-OfficeWordMarkdown [-AllowedImageDirectory <String[]>] [-AllowLocalImages] [-AllowRemoteImages] [-BaseUri <String>] [-FitImagesToContextWidth] [-FitImagesToPageContentWidth] [-FontFamily <String>] -Markdown <String> [-MaxImageHeightPixels <Nullable`1>] [-MaxImageWidthPercentOfContent <Nullable`1>] [-MaxImageWidthPixels <Nullable`1>] [-Open] [-OutputPath <String>] [-PassThru] [-ReaderOptions <MarkdownReaderOptions>] [<CommonParameters>]
#
Parameter set: Markdown

Parameters

AllowedImageDirectory String[] optionalposition: namedpipeline: False
Restrict local images to one or more directories.
AllowLocalImages SwitchParameter optionalposition: namedpipeline: False
Allow local Markdown images to be inserted into the document.
AllowRemoteImages SwitchParameter optionalposition: namedpipeline: False
Allow remote HTTP(S) images to be downloaded and inserted.
BaseUri String optionalposition: namedpipeline: Falsealiases: BasePath
Base URI used to resolve relative links and images.
FitImagesToContextWidth SwitchParameter optionalposition: namedpipeline: False
Fit Markdown images to the current content context width.
FitImagesToPageContentWidth SwitchParameter optionalposition: namedpipeline: False
Fit Markdown images to the page content width.
FontFamily String optionalposition: namedpipeline: False
Optional font family applied during conversion.
Markdown String requiredposition: 0pipeline: True (ByValue)
Markdown text to convert.
MaxImageHeightPixels Nullable`1 optionalposition: namedpipeline: False
Optional hard cap for Markdown image height in pixels.
MaxImageWidthPercentOfContent Nullable`1 optionalposition: namedpipeline: False
Optional hard cap for Markdown image width as a percentage of available content width.
MaxImageWidthPixels Nullable`1 optionalposition: namedpipeline: False
Optional hard cap for Markdown image width in pixels.
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.
ReaderOptions MarkdownReaderOptions optionalposition: namedpipeline: False
Optional Markdown reader options used before Word conversion.

Outputs

OfficeIMO.Word.WordDocument System.IO.FileInfo

ConvertFrom-OfficeWordMarkdown [-AllowedImageDirectory <String[]>] [-AllowLocalImages] [-AllowRemoteImages] [-BaseUri <String>] -FilePath <String> [-FitImagesToContextWidth] [-FitImagesToPageContentWidth] [-FontFamily <String>] [-MaxImageHeightPixels <Nullable`1>] [-MaxImageWidthPercentOfContent <Nullable`1>] [-MaxImageWidthPixels <Nullable`1>] [-Open] [-OutputPath <String>] [-PassThru] [-ReaderOptions <MarkdownReaderOptions>] [<CommonParameters>]
#
Parameter set: Path

Parameters

AllowedImageDirectory String[] optionalposition: namedpipeline: False
Restrict local images to one or more directories.
AllowLocalImages SwitchParameter optionalposition: namedpipeline: False
Allow local Markdown images to be inserted into the document.
AllowRemoteImages SwitchParameter optionalposition: namedpipeline: False
Allow remote HTTP(S) images to be downloaded and inserted.
BaseUri String optionalposition: namedpipeline: Falsealiases: BasePath
Base URI used to resolve relative links and images.
FilePath String requiredposition: 0pipeline: Falsealiases: Path
Path to a Markdown file.
FitImagesToContextWidth SwitchParameter optionalposition: namedpipeline: False
Fit Markdown images to the current content context width.
FitImagesToPageContentWidth SwitchParameter optionalposition: namedpipeline: False
Fit Markdown images to the page content width.
FontFamily String optionalposition: namedpipeline: False
Optional font family applied during conversion.
MaxImageHeightPixels Nullable`1 optionalposition: namedpipeline: False
Optional hard cap for Markdown image height in pixels.
MaxImageWidthPercentOfContent Nullable`1 optionalposition: namedpipeline: False
Optional hard cap for Markdown image width as a percentage of available content width.
MaxImageWidthPixels Nullable`1 optionalposition: namedpipeline: False
Optional hard cap for Markdown image width in pixels.
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.
ReaderOptions MarkdownReaderOptions optionalposition: namedpipeline: False
Optional Markdown reader options used before Word conversion.

Outputs

OfficeIMO.Word.WordDocument System.IO.FileInfo

ConvertFrom-OfficeWordMarkdown [-AllowedImageDirectory <String[]>] [-AllowLocalImages] [-AllowRemoteImages] [-BaseUri <String>] -Document <MarkdownDoc> [-FitImagesToContextWidth] [-FitImagesToPageContentWidth] [-FontFamily <String>] [-MaxImageHeightPixels <Nullable`1>] [-MaxImageWidthPercentOfContent <Nullable`1>] [-MaxImageWidthPixels <Nullable`1>] [-Open] [-OutputPath <String>] [-PassThru] [-ReaderOptions <MarkdownReaderOptions>] [<CommonParameters>]
#
Parameter set: Document

Parameters

AllowedImageDirectory String[] optionalposition: namedpipeline: False
Restrict local images to one or more directories.
AllowLocalImages SwitchParameter optionalposition: namedpipeline: False
Allow local Markdown images to be inserted into the document.
AllowRemoteImages SwitchParameter optionalposition: namedpipeline: False
Allow remote HTTP(S) images to be downloaded and inserted.
BaseUri String optionalposition: namedpipeline: Falsealiases: BasePath
Base URI used to resolve relative links and images.
Document MarkdownDoc requiredposition: namedpipeline: True (ByValue)
Markdown document instance to convert.
FitImagesToContextWidth SwitchParameter optionalposition: namedpipeline: False
Fit Markdown images to the current content context width.
FitImagesToPageContentWidth SwitchParameter optionalposition: namedpipeline: False
Fit Markdown images to the page content width.
FontFamily String optionalposition: namedpipeline: False
Optional font family applied during conversion.
MaxImageHeightPixels Nullable`1 optionalposition: namedpipeline: False
Optional hard cap for Markdown image height in pixels.
MaxImageWidthPercentOfContent Nullable`1 optionalposition: namedpipeline: False
Optional hard cap for Markdown image width as a percentage of available content width.
MaxImageWidthPixels Nullable`1 optionalposition: namedpipeline: False
Optional hard cap for Markdown image width in pixels.
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.
ReaderOptions MarkdownReaderOptions optionalposition: namedpipeline: False
Optional Markdown reader options used before Word conversion.

Outputs

OfficeIMO.Word.WordDocument System.IO.FileInfo