Results 1 to 7 of 7
  1. #1
    New Lounger
    Join Date
    Jan 2006
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Automatically jump to a spot in a document (Word 97)

    Can anyone tell me how I jump to a specific spot in a document when it is opened. I want this to happen automatically and I don't want to set up my document as a locked form. I know it can be done - since I use a similar document (I think she used a bookmark to note the insertion point) but I don't know how to do it myself.

    All suggestions greatly appreciated!

    Thanks!

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

    Re: Automatically jump to a spot in a document (Word 97)

    Select the spot in the document.
    Select Insert | Bookmark...
    Specify a name for the bookmark, e.g. StartHere.
    Click OK.

    Activate the Visual Basic Editor (Alt+F11)
    Double click the ThisDocument node in the Project Explorer (the Windows Explorer-like treeview on the left hand side)
    Copy the following code into the code window that appears:
    <code>
    Private Sub Document_Open()
    Selection.GoTo What:=wdGoToBookmark, Name:="StartHere"
    End Sub
    </code>
    (using the name of the bookmark you just created).
    Switch back to Word and save the document.

    Note: since the document contains macro code, the users will probably get prompted when they open the document; they should enable macros, otherwise the above code will not work.

  3. #3
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Automatically jump to a spot in a document (Word 97)

    You could create a Macro with code like this:
    <code>
    If ActiveDocument.Bookmarks.Exists("OpenToHere") Then
    ActiveDocument.Bookmarks("OpenToHere").Select
    Selection.Collapse Direction:=wdCollapseEnd
    End If
    </code>
    And call that from the AutoOpen of your document or template.

    You would then manually create the bookmark, called in this example OpenToHere, from the Insert Bookmarks menu.

    StuartR

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

    Re: Automatically jump to a spot in a document (Word 97)

    Some use that macro with the built-in bookmark PrevSel1, to jump to the last text that was edited in the previous session:<pre> ActiveDocument.Bookmarks("PrevSel1").Select
    </pre>

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

  5. #5
    Lounger
    Join Date
    Feb 2005
    Location
    Florida, USA
    Posts
    38
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automatically jump to a spot in a document (Word 97)

    I use a very simple trick:

    Go to the place you want to mark,
    Click there once with the mouse,
    Save your document.

    Now, next time you open this document with Word, the mouse cursor will wait for you right there.

    Cheers!

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

    Re: Automatically jump to a spot in a document (Word 97)

    Word doesn't do that automatically. Unless you create a macro as described by Klaus, the insertion point will be at the beginning of a document when you open it.

  7. #7
    Star Lounger
    Join Date
    Nov 2005
    Location
    London, Gtr London, United Kingdom
    Posts
    88
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automatically jump to a spot in a document (Word 97)

    Not exactly the answer, but non-the-less slightly relevant, and sometime usefull!! If, after you open a document, hit "Shift" F5, do document jumps to where your cursor was last when you saved the document!

Posting Permissions

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