Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

New-OfficeRtf

Aliases: OfficeRtf, RtfNew
Module PSWriteOffice
Aliases
OfficeRtf RtfNew
Inputs
System.String[]
Outputs
System.IO.FileInfo OfficeIMO.Rtf.RtfDocument

Creates an RTF document with plain paragraph content.

Syntax

New-OfficeRtf [-NoSave] [-PassThru] [-Path] <String> [[-Text] <String[]>] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Examples

Authored help example

Create a small RTF file.

$file = New-OfficeRtf -Path .\Report.rtf -Text 'Summary', 'Ready for review' -PassThru
Get-OfficeRtf -Path $file.FullName

Creates an RTF document with two paragraphs and returns the file.

Parameters

-NoSave SwitchParameter optional
Return the OfficeIMO RTF document without saving.
-PassThru SwitchParameter optional
Emit a FileInfo for chaining.
-Path String requiredposition: 0aliases: FilePath, OutputPath
Destination path for the RTF file.
-Text String[] optionalposition: 1pipeline: True (ByValue)
Plain paragraph text to add to the document.

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.