Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Aug 2003
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts

    set focus to the beginning of the Document (word 2000 )

    How can i set the focus to the beginning of a Document?

  2. #2
    5 Star Lounger
    Join Date
    May 2001
    Location
    Stuttgart, Baden-W, Germany
    Posts
    931
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: set focus to the beginning of the Document (word 2000 )

    You want the Selection to be an insertion point at the start of the document?
    Recording Ctrl+Home with the macro recorder gives you
    <pre> Selection.HomeKey Unit:=wdStory</pre>


    <pre> ActiveDocument.Range(0,0).Select</pre>

    might be easier to "read", or look more "professional".

    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16> Klaus

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: set focus to the beginning of the Document (word 2000 )

    Try Selection.HomeKey Unit:=wdStory

    Note: you can find out how to do this by recording a macro. For complicated actions, the macro recorder often generates a lot of superfluous (and less than elegant) code, but in this case, the above instruction is exactly what is recorded. And even if the recorded code is more than you need, you can learn a lot about code from it. Click anywhere in the recorded code and press F1 to get context sensitive help, or right click and select Definition; for built-in language elements this starts the Object Browser.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •