Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Apr 2015
    Thanked 0 Times in 0 Posts

    VBS for CommandButton

    Hey guys,

    Still learning word and I have a pretty simple question that I'm hoping you can help with. I'm trying to create a button in a word document to add at the bottom of each page that will take me to the first page. It's a knowledge database and the different sections are hyperlinked, but once you get to the section you have to scroll to the top to get to the index again. I want to insert something that will be at the bottom of each page, so the user can click and be taken back to the index quickly.

    Thank you!!

  2. #2
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Manning, South Carolina
    Thanked 1,454 Times in 1,323 Posts

    If it is really the FIRST page you want why not just Ctrl+Home? HTH
    May the Forces of good computing be with you!


    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  3. #3
    WS Lounge VIP Rick Corbett's Avatar
    Join Date
    Dec 2009
    Thanked 525 Times in 427 Posts
    A CommandButton may be overkill for functionality that is already built-in. Try this (I'm using Word 2010 for this example):

    1. Create a new document.
    2. Create some random text by typing the following then pressing Enter: =rand(10,10)
    3. If you're not already at the bottom of the last page, use Ctrl+End together (similar to RetiredGeek's example above).
    4. Using the Insert tab on the ribbon, select Hyperlink.
    5. In the Insert Hyperlink dialog, select Place in This Document in the left-hand pane.
    6. Select the pre-defined location Top of the Document in the right-hand pane then click on the OK button.

    This will create a text hyperlink to the top of the document without having to create a CommandButton nor write any VBA. You can amend the text of the hyperlink to anything you want, e.g. Click to return..., etc. If you hover your mouse pointer over the hyperlink you will see context help informing you to use Ctrl+Click to follow the hyperlink. Note that this isn't a feature of the .docx format, it works for earlier .doc formats as well. You can even create your own hidden bookmarks and hyperlinks to them.

    Just in case, I've attached a Word doc with examples of 3 different uses of hyperlinks, i.e. 1) Pre-defined, 2) Heading, and 3) Bookmark.

    Hope this helps...
    Attached Files Attached Files

Tags for this Thread

Posting Permissions

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