阅读Microsoft.Office.Interop.Word中的每个段落及其标题 [英] Read each paragraph and its heading in Microsoft.Office.Interop.Word

查看:466
本文介绍了阅读Microsoft.Office.Interop.Word中的每个段落及其标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HI,



我有word文件,其内容在下面给出






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.

foreach (Microsoft.Office.Interop.Word.Paragraph para in Document1.Paragraphs)

       {

          Content=para.Range.Text;



       }


如何获得每个段落的特定标题.如果我们在第2章下使用任何段落,则其标题应为第2章.如何实现此目的?


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?

推荐答案

单词中没有段落标题概念自动化.
每行都视为段落.

如果您想识别段落标题,然后以不同的格式设置它们,也许是可以让它们 BOLD,ITALICS 以及在阅读段落时使它们变为 OLD,ITALICS .也阅读字体样式.

您可以轻松地识别标题.
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.


这篇关于阅读Microsoft.Office.Interop.Word中的每个段落及其标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆