API Reference
Command
New-OfficeWord
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 SetsParameters
- AutoSave SwitchParameter
- Enable OfficeIMO AutoSave mode.
- Content ScriptBlock
- DSL scriptblock describing document content.
- NoSave SwitchParameter
- Skip saving after executing the DSL.
- Open SwitchParameter
- Open the document after saving.
- OutputPath String
- Destination path for the document.
- PassThru SwitchParameter
- Emit a FileInfo for chaining.
Outputs
System.Object