Reputation: 141
I want to make some text bold like that.. • Basic – There are no Cybersecurity
Upvotes: 0
Views: 1872
Reputation: 231
One way of doing this is to insert the bolded text separately into the same paragraph.
// Create the proper formats first
Formatting bold = new Formatting();
bold.Bold = true;
Formatting notBold = new Formatting();
// Create the file
DocX doc = DocX.Create("test.docx");
// Insert the text you want with the proper formatting for each section
Paragraph para = doc.InsertParagraph();
para.InsertText("not bold text ", false, notBold);
para.InsertText("bold text ", false, bold);
para.InsertText("not bold text", false, notBold);
doc.Save();
This will output:
not bold text bold text not bold text
Upvotes: 0