我创建文档类的实例
Microsoft.Office.Interop.Word.Document
如何将表格和文本插入文档中的特殊位置? 例如在一个书签之后或之前
最佳答案
要在word文档中添加文字,可以使用
Word.Range rng = this.Application.ActiveDocument.Range(0, 0);
rng.Text = "New Text";
表格:
Word.Range tableLocation = this.Range(ref start, ref end);
this.Tables.Add(tableLocation, 10, 11);
Set rangeStart = ActiveDocument.Bookmarks("YourFirstBookmark").Range
Set rangeEnd = ActiveDocument.Bookmarks("YourEndBookmark").Range
var range= Range(rangeStart.Start, rangeEnd.End)
关于c# - 在C#中将表格插入到word中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37922619/