首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

这段代码什么意思啊VSTO,该怎么解决

2012-01-14 
这段代码什么意思啊VSTOif(this.Paragraphs.Count0)//为什么这里的this.Paragraphs.Count提示我找不到Par

这段代码什么意思啊VSTO
if   (this.Paragraphs.Count   >   0)//为什么这里的this.Paragraphs.Count   提示我找不到Paragraphs呢。
{
Word.Range   par   =   this.Paragraphs[Paragraphs.Count].Range;
{
Word.Range   singleSent   =   par.Sentences[2];
if   (singleSent   !=   null   &&   singleSent.Words   !=   null   &&
singleSent.Words.Count   >   0)
{
for   (int   i   =   1;   i   <   singleSent.Words.Count;   i++)
{
if   (singleSent.Words[i].Text.ToLower().Trim()   ==
“documents”)
{
Word.Range   removeChar   =   singleSent.Words[i];
removeChar.Delete(ref   missing,   ref   missing);
//delete   and   add   customizations
removeChar.InsertAfter(“   document’s   “);
removeChar.Font.Name   =   “Arial”;
removeChar.Font.Size   =   10F;
removeChar.Font.Color   =
Word.WdColor.wdColorDarkRed;
removeChar.Underline   =
Word.WdUnderline.wdUnderlineDash;
}
}
}
}
}

[解决办法]
这是一段处理WORD的程序,大概是设字体,你添加了OFFICE引用了吗

热点排行