Skip to content

Commit 9d0b2bb

Browse files
committed
Addressed the feedback
1 parent 5f98a31 commit 9d0b2bb

1 file changed

Lines changed: 15 additions & 26 deletions

File tree

  • Paragraphs/Change-bullet-color-and-symbol-in-list/.NET/Change-bullet-color-and-symbol-in-list
Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,25 @@
11
using Syncfusion.DocIO;
22
using Syncfusion.DocIO.DLS;
3-
using System.IO;
43
using Syncfusion.Drawing;
54

6-
namespace Change_bullet_color_and_symbol_in_list
5+
class Program
76
{
8-
class Program
7+
static void Main(string[] args)
98
{
10-
static void Main(string[] args)
9+
//Load the input Word document.
10+
using (WordDocument document = new WordDocument(@"Data/Input.docx", FormatType.Docx))
1111
{
12-
//Open the file as a stream.
13-
using (FileStream inputStream = new FileStream(Path.GetFullPath(@"Data/Input.docx"), FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
14-
{
15-
//Load the file stream into a Word document.
16-
using (WordDocument document = new WordDocument(inputStream, FormatType.Docx))
17-
{
18-
//Access the list style in a Word document.
19-
ListStyle style = document.ListStyles[0];
20-
WListLevel levelOne = style.Levels[0];
21-
//Define the character and pattern for level 1.
22-
levelOne.PatternType = ListPatternType.Bullet;
23-
levelOne.BulletCharacter = "\u0076";
24-
levelOne.CharacterFormat.FontName = "Wingdings";
25-
levelOne.CharacterFormat.TextColor = Color.Red;
26-
//Create a file stream.
27-
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Sample.docx"), FileMode.Create, FileAccess.ReadWrite))
28-
{
29-
//Save the Word document to the file stream.
30-
document.Save(outputFileStream, FormatType.Docx);
31-
}
32-
}
33-
}
12+
//Access the list style in a Word document.
13+
ListStyle style = document.ListStyles[0];
14+
WListLevel levelOne = style.Levels[0];
15+
//Define the character and pattern for level 1.
16+
levelOne.PatternType = ListPatternType.Bullet;
17+
levelOne.BulletCharacter = "\u0076";
18+
levelOne.CharacterFormat.FontName = "Wingdings";
19+
levelOne.CharacterFormat.TextColor = Color.Red;
20+
//Save the Word document.
21+
document.Save(@"Output/Sample.docx", FormatType.Docx);
3422
}
3523
}
3624
}
25+

0 commit comments

Comments
 (0)