OfficeIMO

API Reference

Command

New-OfficeWord

Namespace PSWriteOffice
Inputs
None
Outputs
System.Object

Creates a Word document using the DSL.

Remarks

Creates a Word document using the DSL.

Examples

Create a document inline.


PS>New-OfficeWord -Path .\Report.docx { WordSection { WordParagraph 'Hello DSL' } } -Open
        

Builds a document, adds one paragraph, saves it to disk, and opens it.

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

New-OfficeWord [-AutoSave] [-Content <ScriptBlock>] [-NoSave] [-Open] -OutputPath <String> [-PassThru] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Parameters

AutoSave SwitchParameter optionalposition: namedpipeline: False
Enable OfficeIMO AutoSave mode.
Content ScriptBlock optionalposition: 1pipeline: False
DSL scriptblock describing document content.
NoSave SwitchParameter optionalposition: namedpipeline: False
Skip saving after executing the DSL.
Open SwitchParameter optionalposition: namedpipeline: False
Open the document after saving.
OutputPath String requiredposition: 0pipeline: Falsealiases: FilePath, Path
Destination path for the document.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit a FileInfo for chaining.

Outputs

System.Object