关于设定word样式的问题,急!!!
使用winform调用word 2003
object oMissing = System.Reflection.Missing.Value;
Word._Application oWord = new Word.Application();
oWord.Visible = true;
Word._Document oDoc oDoc= oWord.Documents.Add(ref oMissing, ref oMissing,ref oMissing, ref oMissing);
Word.Selection slt=oWord.Selection;
oDoc.Paragraphs.Add(ref oMissing);
Word.Range oRange oRange=oDoc.Range(ref oMissing,ref oMissing);
slt.Style=oDoc.Styles.Item("标题 3");//我想设置当前行为标题3,结果提示如下: 属性、索引器或事件“Style”不受该语言支持;请尝试直接调用访问器方法“Word.Selection.get_Style()”或“Word.Selection.set_Style(ref object)”----我又找不到它这个东西,请教高手,该如何设置style!!!
oRange.InsertAfter("测试");