Click here to Skip to main content
15,895,423 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
HI,



I have word file, its content is given below


                        Job

Chapter 1

<sup>1</sup> In the land of Uz there lived a man whose name was Job. This man was blameless and upright; he feared God and shunned evil. <sup>2</sup> He had seven sons and three daughters, <sup>3</sup> and he owned seven thousand sheep, three thousand camels, five hundred yoke of oxen and five hundred donkeys, and had a large number of servants. He was the greatest man among all the people of the East.

   <sup>4</sup> His sons used to hold feasts in their homes on their birthdays, and they would invite their three sisters to eat and drink with them. <sup>5</sup> When a period of feasting had run its course, Job would make arrangements for them to be purified. Early in the morning he would sacrifice a burnt offering for each of them, thinking, "Perhaps my children have sinned and cursed God in their hearts." This was Job’s regular custom.

4.1 aaaa

4.2 bbb

4.3 ccc

4.4 eeee

   <sup>6</sup> One day the angels<sup>[</sup><sup>a</sup><sup>]</sup> came to present themselves before the LORD, and Satan<sup>[</sup><sup>b</sup><sup>]</sup> also came with them.<sup>7</sup> The LORD said to Satan, "Where have you come from?"

   Satan answered the LORD, "From roaming throughout the earth, going back and forth on it."

   <sup>8</sup> Then the LORD said to Satan, "Have you considered my servant Job? There is no one on earth like him; he is blameless and upright, a man who fears God and shuns evil."

   <sup>9</sup> "Does Job fear God for nothing?" Satan replied. <sup>10</sup> "Have you not put a hedge around him and his household and everything he has? You have blessed the work of his hands, so that his flocks and herds are spread throughout the land. <sup>11</sup> But now stretch out your hand and strike everything he has, and he will surely curse you to your face."

Chapter 2

<sup>1</sup> Again there was a day when the sons of God came to present themselves before the LORD, and Satan also came among them to present himself before the LORD.

 <sup>2</sup> And the LORD said to Satan, "Whence have you come?" Satan answered the LORD, "From going to and fro on the earth, and from walking up and down on it."



Chapter 3

<sup>1</sup> After this Job opened his mouth and cursed the day of his birth. <sup>2</sup> And Job said: <sup>3</sup> "Let the day perish wherein I was born, and the night which said, 'A man-child is conceived.' <sup>4</sup> Let that day be darkness! May God above not seek it, nor light shine upon it. <sup>5</sup> Let gloom and deep darkness claim it. Let clouds dwell upon it; let the blackness of the day terrify it.





In this part I need each paragraph with particular heading.
C#
foreach (Microsoft.Office.Interop.Word.Paragraph para in Document1.Paragraphs)

       {

          Content=para.Range.Text;



       }

How can I get the particular heading of each paragraph. If we take any paragraph under chapter 2. Its heading should be chapter 2. How can we achieve this?
Posted
Updated 26-Aug-11 0:51am
v3

1 solution

There is no paragraph heading concept in word automation.
each row is considered as paragraph.

if you want to identify the paragraph headers then format them differently, may be u can make them BOLD,ITALICS and while reading paragrahs. read font style too.

you can easily identify the headers.
 
Share this answer
 

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