Formatting


Difference between Text and FormattedText

objRange.Text = the objects unformatted text

sText = objRange.Text 

objRange.FormattedText - returns a range object that represents the text and the formatting

objRange = obAnotherRange.FormattedText 

The FormattedText property has a special use and that is to transfer text and formatting from one range to another


Dim objRange As Range 
objRange = ActiveDocument.Words(2)


Clear Formatting

Removes all character formatting (formatting applied either through character styles or manually applied formatting) from the selected text.

Selection.ClearCharacterAllFormatting 


Removes character formatting (formatting that has been applied manually using the buttons on the Ribbon or through the dialog boxes) from the selected text.

Selection.ClearCharacterDirectFormatting 


Removes character formatting that has been applied through character styles from the selected text.

Selection.ClearCharacterStyle 


Removes text and paragraph formatting from a selection.

Selection.ClearFormatting 


Removes all paragraph formatting (formatting applied either through paragraph styles or manually applied formatting) from the selected text.

Selection.ClearParagraphAllFormatting 


Removes paragraph formatting that has been applied manually (using the buttons on the Ribbon or through the dialog boxes) from the selected text.

Selection.ClearParagraphDirectFormatting 


Removes paragraph formatting that has been applied through paragraph styles from the selected text.

Selection.ClearParagraphStyle 

Selection.Paragraph.Reset 

Selection.Paragraphs.Reset 

Selection.ParagraphFormat.Reset 

Selection.Font.Reset 


© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext