Position cursor at start/end of Word document

后端 未结 9 777
误落风尘
误落风尘 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

    I use unit Word_TLB in Delphi with Appliction object- Word.Application

    as following:

    aWordDoc.Application.Selection.EndKey(wdStory,wdMove);
    

    generally end of word document is:

    Selection.EndKey( WdUnits.wdStory, WdMovementType.wdMove)
    

    When I use

    Selection.GoTo(Word.WdGoToItem.wdGoToLine, Word.WdGoToDirection.wdGoToLast, Nothing, Nothing);
    Selection.InsertFile('documnet.docx');
    

    new content was insert before last line.

提交回复
热议问题