API Reference

Cmdlet

Update-OfficeRtfText

Aliases: Replace-OfficeRtfText, RtfText
Namespace PSWriteOffice
Aliases
Replace-OfficeRtfText RtfText
Inputs
System.String
Outputs
System.IO.FileInfo

Applies lossless text and metadata edits to an RTF document.

Remarks

Applies lossless text and metadata edits to an RTF document.

Examples

Authored help example

Replace text in an RTF file.

PS>


New-OfficeRtf -Path .\Input.rtf -Text 'Status: Draft'
            Update-OfficeRtfText -Path .\Input.rtf -OutputPath .\Output.rtf -OldText Draft -NewText Final -PassThru
        

Uses OfficeIMO.Rtf's lossless editor to update visible text while preserving untouched RTF syntax.

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

Update-OfficeRtfText [-AppendParagraph <String[]>] [-CaseInsensitive] [-DocumentProperty <IDictionary>] [-DocumentVariable <IDictionary>] [-NewText <String>] [-OldText <String>] -OutputPath <String> [-PassThru] -Path <String> [-UserProperty <IDictionary>] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Parameters

AppendParagraph String[] optionalposition: namedpipeline: False
Plain paragraphs to append to the end of the RTF document.
CaseInsensitive SwitchParameter optionalposition: namedpipeline: False
Use ordinal case-insensitive text replacement.
DocumentProperty IDictionary optionalposition: namedpipeline: False
Document info fields to set, such as Title, Author, Company, or Comments.
DocumentVariable IDictionary optionalposition: namedpipeline: False
Document variables to set.
NewText String optionalposition: namedpipeline: False
Replacement visible text.
OldText String optionalposition: namedpipeline: False
Visible text to replace.
OutputPath String requiredposition: namedpipeline: False
Destination RTF file path.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit a FileInfo for chaining.
Path String requiredposition: 0pipeline: True (ByValue)aliases: FilePath
Source RTF file path.
UserProperty IDictionary optionalposition: namedpipeline: False
Custom user properties to set.

Outputs

System.IO.FileInfo