Word.Range range1, range2; // 跳转种类 object objWhat = Word.WdGoToItem.wdGoToPage; // 跳转位置 object objWhich = Word.WdGoToDirection.wdGoToLast; // 转向最后一页 WordApp.Selection.GoTo(ref objWhat, ref objWhich, ref Nothing, ref Nothing); // Range取得 range1 = WordApp.Selection.Range; range2 = WordApp.ActiveDocument.Range(ref Nothing, ref Nothing); object start = range1.Start; object end = range2.End; // 删除最后一页 WordApp.ActiveDocument.Range(ref start, ref end).Delete(ref Nothing, ref Nothing);
贴上部分代码。帮忙看看为啥就是不删除。