Click here to Skip to main content
12,629,493 members (35,418 online)
Rate this:
 
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
Comments
DinoRondelly 25-Feb-13 13:12pm
   
What are these so many things that you have tried?
Sandeep Mewara 25-Feb-13 13:36pm
   
+5
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

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 27-Feb-13 18:17pm
   
Good idea, come to think about. Manual numbering is evil. My 5.
—SA
Andreas Gieriet 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
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.161205.3 | Last Updated 25 Feb 2013
Copyright © CodeProject, 1999-2016
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