1 using Word = NetOffice.WordApi;
 2 
 3 Word.Document doc = this._wordApplication.Documents.Add(@"C:\Users\li\Desktop\新建文件夹 (3)\Doc1.docx");
 4 
 5 Word.ContentControl contentControl = doc.ContentControls.Add();
 6 contentControl.Title = "测试";
 7 contentControl.Tag = "test";
 8 
 9 object type = @"Excel.Sheet";//插入的excel
10 contentControl.Range.InlineShapes.AddOLEObject(type);

 

posted on 2018-07-23 12:19  天之梅子  阅读(612)  评论(0编辑  收藏  举报