Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / June 2005

Tip: Looking for answers? Try searching our database.

How to place the cursor to the first position in a page

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jeremy - 25 Jun 2005 04:23 GMT
I would like to be able to put my cursor (create a range) at the beggining
(top most) cursor position in a page.

I would appreciate your help
Word Heretic - 25 Jun 2005 06:22 GMT
G'day Jeremy <Jeremy@discussions.microsoft.com>,

Iterate the characters of the range, examining their
Range.Information(wdActiveEndPageNumber) until it changes.

Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice

Jeremy reckoned:

>I would like to be able to put my cursor (create a range) at the beggining
>(top most) cursor position in a page.
>
>I would appreciate your help
Doug Robbins - 25 Jun 2005 06:34 GMT
Use

Selection.Bookmarks("\page").Range.Select
Selection.Collapse wdCollapseStart

or

Dim myrange as Range
Set myrange = Selection.Bookmarks("\page").Range
myrange.end = myrange.start

That will cause the range object myrange to be the first position on the
page.  It will NOT move the selection to that point, which you may not need
to do.  If you do need to, you would need to add

myrange.Select

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

>I would like to be able to put my cursor (create a range) at the beggining
> (top most) cursor position in a page.
>
> I would appreciate your help
Word Heretic - 25 Jun 2005 07:06 GMT
G'day "Doug Robbins" <dkr@REMOVEmvps.org>,

Out of interest Doug, have you had problems using this method? I have,
maybe I should bother to investigate this further one day :-)

Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice

Doug Robbins reckoned:

>Use
>
[quoted text clipped - 12 lines]
>
>myrange.Select
Doug Robbins - 25 Jun 2005 07:46 GMT
Hi Steve,

It has always worked for me, not that I use it every day though.

Regards from Paris,
Doug Robbins - Word MVP
> G'day "Doug Robbins" <dkr@REMOVEmvps.org>,
>
[quoted text clipped - 25 lines]
>>
>>myrange.Select
Shauna Kelly - 26 Jun 2005 05:45 GMT
Hi Doug, Steve

I find that Bookmarks("\page") fails if a row in a table breaks across a
page.

If the cursor in a row that breaks, on the page that the row starts, then
Selection.Bookmarks("\page").Range will return the whole of that page plus
the entire table going forward to the end of the table. If the cursor is in
a row that breaks, on a middle page of the row (ie if the row spans 3 pages
or more), then Selection.Bookmarks("\page").Range returns the entire table.
If the cursor is in a row that breaks, but on the last page of the table,
then Selection.Bookmarks("\page").Range returns the whole of that page plus
the entire table, going back to the beginning of the table.

Cheers

Shauna

Shauna Kelly.  Microsoft MVP.
http://www.shaunakelly.com/word

> Hi Steve,
>
[quoted text clipped - 31 lines]
>>>
>>>myrange.Select
Howard Kaikow - 26 Jun 2005 16:58 GMT
I find the following to be a safe way to do things.
Also, helps wean fokes off the selection object,

dim rng as Word.Range
set rng = activedocument.content
with rng
   .collapse direction:=wdCollapseStart
   .select
end with

Signature

http://www.standards.com/; See Howard Kaikow's web site.

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.