Skip to content

Commit b99e648

Browse files
Addressed feedback
1 parent f533bad commit b99e648

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

  • Paragraphs/Change_Font_Size_For_Highlighted_Texts/.NET/Change_Font_Size_For_Highlighted_Texts

Paragraphs/Change_Font_Size_For_Highlighted_Texts/.NET/Change_Font_Size_For_Highlighted_Texts/Program.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,12 @@ static void Main(string[] args)
1818
// Iterates the text ranges.
1919
foreach (Entity entity in entities)
2020
{
21-
//Replaces the text with another.
21+
// Casts the entity as WTextRange.
2222
WTextRange textRange = entity as WTextRange;
2323
// Get character format of the text
2424
WCharacterFormat charFormat = textRange.CharacterFormat;
25-
//Checks whether text has highlightcolor
26-
if (!charFormat.HighlightColor.IsEmpty)
27-
{
28-
//If text has highlight color, set text's font size larger
29-
charFormat.FontSize = 14;
30-
}
25+
// Set text's font size larger
26+
charFormat.FontSize = 14;
3127
}
3228
//Creates file stream.
3329
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"../../../Output/Result.docx"), FileMode.Create, FileAccess.ReadWrite))

0 commit comments

Comments
 (0)