Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: C#
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.
Posted 25-Feb-13 8:03am
DinoRondelly at 25-Feb-13 13:12pm
What are these so many things that you have tried?
Sandeep Mewara at 25-Feb-13 13:36pm
sasen903 at 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

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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 at 27-Feb-13 18:17pm
Good idea, come to think about. Manual numbering is evil. My 5.
Andreas Gieriet at 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)

  Print Answers RSS
0 Peter Leow 160
1 Mika Wendelius 156
2 Abhinav S 155
3 Sergey Alexandrovich Kryukov 115
4 TheRealSteveJudge 114
0 Sergey Alexandrovich Kryukov 8,593
1 OriginalGriff 6,536
2 Peter Leow 3,727
3 Zoltán Zörgő 3,436
4 Richard MacCutchan 2,417

Advertise | Privacy | Mobile
Web01 | 2.8.150123.1 | Last Updated 25 Feb 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100