API Reference
Cmdlet
Update-OfficeRtfText
Applies lossless text and metadata edits to an RTF document.
Remarks
Applies lossless text and metadata edits to an RTF document.
Examples
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 SetsParameters
- AppendParagraph String[]
- Plain paragraphs to append to the end of the RTF document.
- CaseInsensitive SwitchParameter
- Use ordinal case-insensitive text replacement.
- DocumentProperty IDictionary
- Document info fields to set, such as Title, Author, Company, or Comments.
- DocumentVariable IDictionary
- Document variables to set.
- NewText String
- Replacement visible text.
- OldText String
- Visible text to replace.
- OutputPath String
- Destination RTF file path.
- PassThru SwitchParameter
- Emit a FileInfo for chaining.
- Path String
- Source RTF file path.
- UserProperty IDictionary
- Custom user properties to set.
Outputs
System.IO.FileInfo