Click here to Skip to main content
Rate this: bad
good
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 7:03am
Comments
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
   
+5
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
good
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).
Cheers
Andi
  Permalink  
Comments
Sergey Alexandrovich Kryukov at 27-Feb-13 18:17pm
   
Good idea, come to think about. Manual numbering is evil. My 5.
—SA
Andreas Gieriet at 27-Feb-13 20:50pm
   
Thanks for your 5!
Andi

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 398
1 CPallini 333
2 George Jonsson 270
3 OriginalGriff 159
4 Prasad Khandekar 135
0 OriginalGriff 4,613
1 CPallini 3,340
2 Sergey Alexandrovich Kryukov 2,771
3 George Jonsson 2,254
4 Gihan Liyanage 2,020


Advertise | Privacy | Mobile
Web03 | 2.8.140905.1 | Last Updated 25 Feb 2013
Copyright © CodeProject, 1999-2014
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