VSTO 向office文档中插入内容

原文: VSTO 向office文档中插入内容

Word:

            Word.Selection sec = ThisAddIn.appWord.Selection;
            sec.InsertAfter(value);

Excel:

            Excel.Workbook wbook = Globals.ThisAddIn.Application.ActiveWorkbook;  //当前活动workbook
            Excel.Worksheet wsheet = (Excel.Worksheet)wbook.ActiveSheet;          //当前活动sheet           
            Excel.Range range = wsheet.Application.ActiveCell;       //当前活动的cell
            value = range.Text + " " + value;
            range.set_Value(Type.Missing, value); 

Outlook:

           Word.Document document1 = this.inspector.WordEditor;
           document1.Application.Selection.InsertAfter(value);

上一篇:go编译.so文件在python中执行


下一篇:Broadcom以太网交换芯片培训