Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Word
application.errors
conversions
docmanagement
drawing.graphics
formatting.longdocs
international
internet.assistant
mail
mailmerge.fields
menustoolbars
newusers
numbering
oleinterop
pagelayout
printingfonts
setup.networking
spelling.grammar
tables
vba.addins
vba.beginners
vba.customization
vba.general
vba.userforms
web.authoring
word6-7macros
word97vba
  
 
date: Sat, 27 Sep 2008 23:03:18 -0700 (PDT),    group: microsoft.public.word.vba.general        back       


How to move to last line of current page?   
Hello.
There is one document with many pages. The insert point is on one (on
any) page. I need to move to last line (in start this line) on this
page. How can I do it?
Thank you.
date: Sat, 27 Sep 2008 23:03:18 -0700 (PDT)   author:   avkokin

RE: How to move to last line of current page?   
Something like the following should work:

    'Go to end of current page
    ActiveDocument.Bookmarks("\Page").Range.Characters.Last.Select
    'Move to start of the line
    Selection.HomeKey wdLine

Note, however, that in case of the last page in a document, the “\Page” 
bookmark does not include the last paragraph mark on the page. Therefore, if 
the last paragraph in the document is an empty paragraph and if the last page 
contains more than that paragraph, the code above will position the insertion 
marker in the start of the second last line.

-- 
Regards
Lene Fredborg - Microsoft MVP (Word)
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word


"avkokin" wrote:

> Hello.
> There is one document with many pages. The insert point is on one (on
> any) page. I need to move to last line (in start this line) on this
> page. How can I do it?
> Thank you.
>
date: Sun, 28 Sep 2008 01:10:06 -0700   author:   Lene Fredborg

Re: How to move to last line of current page?   
How about

Dim oPage As Range
Set oPage = ActiveDocument.Bookmarks("\page").Range
oPage.Select
With Selection
    .EndKey
    .HomeKey
End With


-- 
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


avkokin wrote:
> Hello.
> There is one document with many pages. The insert point is on one (on
> any) page. I need to move to last line (in start this line) on this
> page. How can I do it?
> Thank you.
date: Sun, 28 Sep 2008 11:20:39 +0300   author:   Graham Mayor

Re: How to move to last line of current page?   
Thank you very much!
date: Sun, 28 Sep 2008 06:10:30 -0700 (PDT)   author:   avkokin

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us