Position cursor at start/end of Word document

后端 未结 9 795
误落风尘
误落风尘 2020-12-11 16:39

We are manipulating our Word 2007 documents from .Net using Word Interop. Mostly doing stuff with fields as in:

For Each f In d.Fields
    f.Select()
    //d         


        
9条回答
  •  忘掉有多难
    2020-12-11 17:06

    To change cursor position at the end of the current document in a C# Word Add-In VSTO :

    this.Application.ActiveDocument.Range(
    this.Application.ActiveDocument.Content.End-1,
    this.Application.ActiveDocument.Content.End-1).Select();
    

    See How to: Programmatically Define and Select Ranges in Documents

提交回复
热议问题