public void UpdateBookMarkText(string bookmarkName, string text)
{
try
{
object bkName = bookmarkName;
Bookmark bk = document.Application.ActiveDocument.Bookmarks.get_Item(ref bkName);
var newend = bk.Range.Start + text.Length;
var name = bk.Name;
Range range = bk.Range;
bk.Range.Text = text;
range.End = newend;
document.Application.ActiveDocument.Bookmarks.Add(name, range);
MessageBox.Show("操作成功!");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}