使用C#选择Word中每个新段落的第一个字符

时间:2013-03-31 04:32:32

标签: c# ms-word

我正在进行Word Automation,并希望选择Word中每个新段落的每个第一个字符。使用我的代码,我只能选择的第一个字符,而不是任何其他。谁能告诉我哪里出错?

foreach (Word.Paragraph aPar in oWordDoc.Paragraphs) {

    Word.Range parRng = aPar.Range;
    string sText = parRng.Text;
    object startLocation5 = 2;
    object endLocation5 = 3;
    rng5 = oWordDoc.Range(ref startLocation5, ref endLocation5);
    rng5.Text = rng5.Text;
}

这是我的文件:

  

馏分(甘露聚糖和木聚糖)进行酶水解。结晶性lulose的酶促水解,可发酵的D - 葡萄糖[71,74-79]。

     

特别在软木中存在的半乳糖(gluco)甘露聚糖的酶水解是通过内切-b-1,4-甘露聚糖酶的作用完成的,随机裂解

我想选择' f'然后' T' (第2段的第1个字符)。

0 个答案:

没有答案