Click here to Skip to main content
15,040,743 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
I am preparing a word document using C#.I am using Microsoft.Office.Interop.Word.I got stuck while numbering the paragraphs.

Suppose I have to print like this in the word document.

1. Heading1

some text is here

1.1 Sub heading1

some text is here

1.1.1 Sub heading2

some text is here

2. Heading2

some text is here

Please help me. I have tried so many things but not able to do that.
DinoRondelly 25-Feb-13 13:12pm
What are these so many things that you have tried?
Sandeep Mewara 25-Feb-13 13:36pm
sasen903 25-Feb-13 23:46pm
I can not use Spire.Doc I have to use Microsoft.Office.Interop.Word only.
Otherwise it could be eseair using Spire.Doc

1 solution

Select the proper paragraph style - don't number explicitly.
There are HeadingX styles. Define the numbering scheme there (e.g. in the normal.dotx).
Sergey Alexandrovich Kryukov 27-Feb-13 18:17pm
Good idea, come to think about. Manual numbering is evil. My 5.
Andreas Gieriet 27-Feb-13 20:50pm
Thanks for your 5!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900