0

I want to make some text bold like that.. • Basic – There are no Cybersecurity

user3424829
  • 121
  • 1
  • 3
  • 10

1 Answers1

0

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

DCOPTimDowd
  • 231
  • 1
  • 11