API Reference

Cmdlet

ConvertFrom-OfficeWordMarkdown

Aliases: ConvertFrom-WordMarkdown
Namespace PSWriteOffice
Aliases
ConvertFrom-WordMarkdown
Inputs
OfficeIMO.Markdown.MarkdownDoc System.String
Outputs
OfficeIMO.Word.WordDocument System.IO.FileInfo

Creates a Word document from Markdown.

Remarks

Returns a WordDocument or saves it to disk when -OutputPath is provided.

Examples

Authored help example

Example 1: Create a .docx from Markdown text.

PS>


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

Writes a Word document containing the supplied Markdown.

Example 2: Pipe a Markdown document into Word conversion.

PS>


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

Returns a Word document instance for further edits.

Example 3: Insert Markdown into a Word template bookmark.

PS>


ConvertFrom-OfficeWordMarkdown -Path .\SOP.md -TemplatePath .\Template.docx -BookmarkName MainContent -OutputPath .\SOP.docx
        

Copies the template and replaces the bookmark paragraph with generated Markdown content.

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 [-AllowDataUriImages <Nullable`1>] [-AllowedImageDirectory <String[]>] [-AllowLocalImages] [-AllowRemoteImages] [-BaseUri <String>] [-BookmarkName <String>] [-ContentControlAlias <String>] [-ContentControlTag <String>] [-FitImagesToContextWidth] [-FitImagesToPageContentWidth] [-FontFamily <String>] [-KeepPlaceholder] -Markdown <String> [-MaxDataUriImageBytes <Nullable`1>] [-MaxImageHeightPixels <Nullable`1>] [-MaxImageWidthPercentOfContent <Nullable`1>] [-MaxImageWidthPixels <Nullable`1>] [-NormalizeInput <Nullable`1>] [-Open] [-OutputPath <String>] [-PassThru] [-PreferNarrativeSingleLineDefinitions] [-Profile <Nullable`1>] [-ReaderOptions <MarkdownReaderOptions>] [-RenderFrontMatter] [-TemplatePath <String>] [-Theme <Nullable`1>] [<CommonParameters>]
#
Parameter set: Markdown

Parameters

AllowDataUriImages Nullable`1 optionalposition: namedpipeline: False
Allow data URI Markdown images to be embedded in Word output.
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.
BookmarkName String optionalposition: namedpipeline: False
Bookmark name that marks where Markdown content should be inserted in the template.
ContentControlAlias String optionalposition: namedpipeline: False
Block content control alias that marks where Markdown content should be inserted in the template.
ContentControlTag String optionalposition: namedpipeline: False
Block content control tag that marks where Markdown content should be inserted in the template.
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.
KeepPlaceholder SwitchParameter optionalposition: namedpipeline: False
Keep the target bookmark or content-control placeholder after inserting Markdown content.
Markdown String requiredposition: 0pipeline: True (ByValue)
Markdown text to convert.
MaxDataUriImageBytes Nullable`1 optionalposition: namedpipeline: False
Maximum decoded size for one data URI image.
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.
NormalizeInput Nullable`1 optionalposition: namedpipeline: False
Applies a built-in Markdown input normalization preset before parsing. Possible values: None, IntelligenceXTranscript, IntelligenceXTranscriptStrict, DocsLoose
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.
PreferNarrativeSingleLineDefinitions SwitchParameter optionalposition: namedpipeline: False
Prefer narrative paragraphs for isolated single-line definition-list patterns.
Profile Nullable`1 optionalposition: namedpipeline: False
Named Markdown reader profile used when ReaderOptions is not supplied. Possible values: OfficeIMO, CommonMark, GitHubFlavoredMarkdown, Portable
ReaderOptions MarkdownReaderOptions optionalposition: namedpipeline: False
Optional Markdown reader options used before Word conversion.
RenderFrontMatter SwitchParameter optionalposition: namedpipeline: False
Render YAML front matter as visible Word content. Template conversions hide front matter by default.
TemplatePath String optionalposition: namedpipeline: Falsealiases: Template
Optional Word template document to copy before inserting Markdown content.
Theme Nullable`1 optionalposition: namedpipeline: False
Shared Markdown visual theme for generated Word output. Possible values: Plain, WordLike, TechnicalDocument, GitHubLike, Compact, Report

Outputs

OfficeIMO.Word.WordDocument, System.IO.FileInfo

ConvertFrom-OfficeWordMarkdown [-AllowDataUriImages <Nullable`1>] [-AllowedImageDirectory <String[]>] [-AllowLocalImages] [-AllowRemoteImages] [-BaseUri <String>] [-BookmarkName <String>] [-ContentControlAlias <String>] [-ContentControlTag <String>] -FilePath <String> [-FitImagesToContextWidth] [-FitImagesToPageContentWidth] [-FontFamily <String>] [-KeepPlaceholder] [-MaxDataUriImageBytes <Nullable`1>] [-MaxImageHeightPixels <Nullable`1>] [-MaxImageWidthPercentOfContent <Nullable`1>] [-MaxImageWidthPixels <Nullable`1>] [-NormalizeInput <Nullable`1>] [-Open] [-OutputPath <String>] [-PassThru] [-PreferNarrativeSingleLineDefinitions] [-Profile <Nullable`1>] [-ReaderOptions <MarkdownReaderOptions>] [-RenderFrontMatter] [-TemplatePath <String>] [-Theme <Nullable`1>] [<CommonParameters>]
#
Parameter set: Path

Parameters

AllowDataUriImages Nullable`1 optionalposition: namedpipeline: False
Allow data URI Markdown images to be embedded in Word output.
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.
BookmarkName String optionalposition: namedpipeline: False
Bookmark name that marks where Markdown content should be inserted in the template.
ContentControlAlias String optionalposition: namedpipeline: False
Block content control alias that marks where Markdown content should be inserted in the template.
ContentControlTag String optionalposition: namedpipeline: False
Block content control tag that marks where Markdown content should be inserted in the template.
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.
KeepPlaceholder SwitchParameter optionalposition: namedpipeline: False
Keep the target bookmark or content-control placeholder after inserting Markdown content.
MaxDataUriImageBytes Nullable`1 optionalposition: namedpipeline: False
Maximum decoded size for one data URI image.
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.
NormalizeInput Nullable`1 optionalposition: namedpipeline: False
Applies a built-in Markdown input normalization preset before parsing. Possible values: None, IntelligenceXTranscript, IntelligenceXTranscriptStrict, DocsLoose
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.
PreferNarrativeSingleLineDefinitions SwitchParameter optionalposition: namedpipeline: False
Prefer narrative paragraphs for isolated single-line definition-list patterns.
Profile Nullable`1 optionalposition: namedpipeline: False
Named Markdown reader profile used when ReaderOptions is not supplied. Possible values: OfficeIMO, CommonMark, GitHubFlavoredMarkdown, Portable
ReaderOptions MarkdownReaderOptions optionalposition: namedpipeline: False
Optional Markdown reader options used before Word conversion.
RenderFrontMatter SwitchParameter optionalposition: namedpipeline: False
Render YAML front matter as visible Word content. Template conversions hide front matter by default.
TemplatePath String optionalposition: namedpipeline: Falsealiases: Template
Optional Word template document to copy before inserting Markdown content.
Theme Nullable`1 optionalposition: namedpipeline: False
Shared Markdown visual theme for generated Word output. Possible values: Plain, WordLike, TechnicalDocument, GitHubLike, Compact, Report

Outputs

OfficeIMO.Word.WordDocument, System.IO.FileInfo

ConvertFrom-OfficeWordMarkdown [-AllowDataUriImages <Nullable`1>] [-AllowedImageDirectory <String[]>] [-AllowLocalImages] [-AllowRemoteImages] [-BaseUri <String>] [-BookmarkName <String>] [-ContentControlAlias <String>] [-ContentControlTag <String>] -Document <MarkdownDoc> [-FitImagesToContextWidth] [-FitImagesToPageContentWidth] [-FontFamily <String>] [-KeepPlaceholder] [-MaxDataUriImageBytes <Nullable`1>] [-MaxImageHeightPixels <Nullable`1>] [-MaxImageWidthPercentOfContent <Nullable`1>] [-MaxImageWidthPixels <Nullable`1>] [-NormalizeInput <Nullable`1>] [-Open] [-OutputPath <String>] [-PassThru] [-PreferNarrativeSingleLineDefinitions] [-Profile <Nullable`1>] [-ReaderOptions <MarkdownReaderOptions>] [-RenderFrontMatter] [-TemplatePath <String>] [-Theme <Nullable`1>] [<CommonParameters>]
#
Parameter set: Document

Parameters

AllowDataUriImages Nullable`1 optionalposition: namedpipeline: False
Allow data URI Markdown images to be embedded in Word output.
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.
BookmarkName String optionalposition: namedpipeline: False
Bookmark name that marks where Markdown content should be inserted in the template.
ContentControlAlias String optionalposition: namedpipeline: False
Block content control alias that marks where Markdown content should be inserted in the template.
ContentControlTag String optionalposition: namedpipeline: False
Block content control tag that marks where Markdown content should be inserted in the template.
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.
KeepPlaceholder SwitchParameter optionalposition: namedpipeline: False
Keep the target bookmark or content-control placeholder after inserting Markdown content.
MaxDataUriImageBytes Nullable`1 optionalposition: namedpipeline: False
Maximum decoded size for one data URI image.
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.
NormalizeInput Nullable`1 optionalposition: namedpipeline: False
Applies a built-in Markdown input normalization preset before parsing. Possible values: None, IntelligenceXTranscript, IntelligenceXTranscriptStrict, DocsLoose
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.
PreferNarrativeSingleLineDefinitions SwitchParameter optionalposition: namedpipeline: False
Prefer narrative paragraphs for isolated single-line definition-list patterns.
Profile Nullable`1 optionalposition: namedpipeline: False
Named Markdown reader profile used when ReaderOptions is not supplied. Possible values: OfficeIMO, CommonMark, GitHubFlavoredMarkdown, Portable
ReaderOptions MarkdownReaderOptions optionalposition: namedpipeline: False
Optional Markdown reader options used before Word conversion.
RenderFrontMatter SwitchParameter optionalposition: namedpipeline: False
Render YAML front matter as visible Word content. Template conversions hide front matter by default.
TemplatePath String optionalposition: namedpipeline: Falsealiases: Template
Optional Word template document to copy before inserting Markdown content.
Theme Nullable`1 optionalposition: namedpipeline: False
Shared Markdown visual theme for generated Word output. Possible values: Plain, WordLike, TechnicalDocument, GitHubLike, Compact, Report

Outputs

OfficeIMO.Word.WordDocument, System.IO.FileInfo