Position cursor at start/end of Word document

后端 未结 9 787
误落风尘
误落风尘 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 16:51

    @Alexander Kojevnikov: Thanks for your help because you put me on the right track. However I found I had to apply the .GoTo to the Word Selection object, not the Document. As in:

        Dim what As Object = Word.WdGoToItem.wdGoToLine
        Dim which As Object = Word.WdGoToDirection.wdGoToLast
    
        //below line had no effect
        //d.GoTo(what, which, Nothing, Nothing)
    
        w.Selection.GoTo(what, which, Nothing, Nothing)
    

提交回复
热议问题