Word VBA - position in code

Posted on 2007-10-05
Last Modified: 2012-05-05
hello - I am using this to reference a page

Selection.GoTo wdGoToPage, wdGoToAbsolute, p3

However after i get the code to get to this page I would like to position the cursor (before it carrys on) three lines down from the top of the page - how can i do this.

Is this the best way in which to get a position on a page in the document ?

Many thanks,

Question by:gisvpn
    LVL 9

    Accepted Solution


        Selection.MoveDown Unit:=wdLine, Count:=3


    Author Comment

    perfect thanks - is this the best way in which to reference something in a document ?
    LVL 9

    Expert Comment

    I usually use bookmarks in word docs when I need to select areas

    Author Comment

    Can a book mark marker a position as well as an area?
    LVL 9

    Expert Comment


    In word 2007 (Im sure its the same for other versions) you just highlight the area select insert bookmark

    then this macro would select it

     Selection.GoTo What:=wdGoToBookmark, Name:="me"
        With ActiveDocument.Bookmarks
            .DefaultSorting = wdSortByName
            .ShowHidden = False
        End With
        ShowVisualBasicEditor = True
    End Sub

    ANother option I have used is section breaks for separating areas.

    Author Comment

    cool thanks :)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
    Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
    This video shows the viewer how to set up and create Footnotes in their document. Click on the References tab: Select "Insert Footnote": Type in desired text:
    This Micro Tutorial well show you how to find and replace special characters in Microsoft Word. This is similar to carriage returns to convert columns of values from Microsoft Excel into comma separated lists.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now