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 / November 2004

Tip: Looking for answers? Try searching our database.

Problem going to last line of a huge Word document

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
wilson - 03 Nov 2004 09:43 GMT
I have a Word document over 1300 pages (> 70000 lines).
When I use Visual Basic code

   Selection.GoTo What:=wdGoToLine, Which:=wdGoToLast

it does not go to the last line. It stops at page 600 around. But this
Visual Basic code works fine for most of the documents. Is there any
workarounds to get rid of this?

Thank you so much.
wilson - 03 Nov 2004 10:11 GMT
It seems that it cannot go to > 32767 lines.

>I have a Word document over 1300 pages (> 70000 lines).
> When I use Visual Basic code
[quoted text clipped - 6 lines]
>
> Thank you so much.
Klaus Linke - 03 Nov 2004 12:05 GMT
> >    Selection.GoTo What:=wdGoToLine, Which:=wdGoToLast
> [...]
> It seems that it cannot go to > 32767 lines.

Hi Wilson,

I see this, too. You can use
 Selection.EndKey Unit:=wdStory
or
 Selection.Start=ActiveDocument.Content.End
or something like that as a work-around.

Most other "targets" for GoTo are limited to less that 2^15 anyway (max
16.379 bookmarks, 32.000 fields).
The VBA help says that Word uses a variant for the count, but probably it
really uses a signed integer (limited to +/- 32767) somewhere along the
way...

Regards,
Klaus
wilson - 04 Nov 2004 02:33 GMT
Agree. Seems many things relate to the magic number 32767.
Thanks for the work-arounds.

>> >    Selection.GoTo What:=wdGoToLine, Which:=wdGoToLast
>> [...]
[quoted text clipped - 16 lines]
> Regards,
> Klaus
 
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.