आप पहले पैराग्राफ को एक हेडिंग और दूसरे पैराग्राफ को बॉडी के रूप में सेट कर सकते हैं।
सी # कोड यहां:
//Create Document
Document document = new Document();
Section section = document.AddSection();
Paragraph paragraph
= section.Paragraphs.Count > 0 ? section.Paragraphs[0] : section.AddParagraph();
//Heading 1
paragraph = section.AddParagraph();
paragraph.AppendText(BuiltinStyle.Heading1.ToString());
paragraph.ApplyStyle(BuiltinStyle.Heading1);
paragraph.ListFormat.ApplyNumberedStyle();
//Heading 2
paragraph = section.AddParagraph();
paragraph.AppendText(BuiltinStyle.Heading2.ToString());
paragraph.ApplyStyle(BuiltinStyle.Heading2);
//Number Format(list) for Headings
ListStyle listSty2 = new ListStyle(document, ListType.Numbered);
foreach (ListLevel listLev in listSty2.Levels)
{
listLev.UsePrevLevelPattern = true;
listLev.NumberPrefix = “1.”;
}
listSty2.Name = “MyStyle2″;
document.ListStyles.Add(listSty2);
paragraph.ListFormat.ApplyStyle(listSty2.Name);
ListStyle listSty3 = new ListStyle(document, ListType.Numbered);
foreach (ListLevel listLev in listSty3.Levels)
{
listLev.UsePrevLevelPattern = true;
listLev.NumberPrefix = “1.1.”;
}
listSty3.Name = “MyStyle3″;
document.ListStyles.Add(listSty3);
//Heading 3
for (int i = 0; i < 4; i++)
{
paragraph = section.AddParagraph();
//Append Text
paragraph.AppendText(“Heading3″);
//Apply Style
paragraph.ApplyStyle(BuiltinStyle.Heading3);
paragraph.ListFormat.ApplyStyle(listSty3.Name);
}
मैं एक .NET वर्ड घटक का उपयोग करता हूं ।