Visual Basic question: end of Page

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm new to Visual Basic. I am curious as to why there are document elements
for words, paragraphs & sections but not for pages.

Within a multi-page document, I am trying to select text from a point midway
down a page to the end of the page (the number of paragraphs is variable on
each page) in order to reformat that portion of each page.

Any suggestions?
 
Record a macro like this:
Click once where you are going to start your selection
Start the macro recorder;
give the macro a name you will associate with this process
Insert a bookmark called "StartSel"
CTRL+G (which is GotTo), Page, click Next, click Close
Press left arrow key once
Insert a bookmark called "EndSel"
Close the macro recorder

Now press ALT+F8, highlight the macro you just recorded, and click Edit.
Just under the first line ("Sub YourMacro()"), type:
Dim myRange As Range

Copy the following lines from this post:
Set myRange = ActiveDocument.Bookmarks("StartSel").Range
myRange.SetRange _
myRange.Start, _
ActiveDocument.Bookmarks("EndSel").Range.End
myRange.Select

Paste these into the macro just above End Sub.

HTH
Ed
 
For great how-to tips and general programming information, check out the Word
programming forum in the Office Discussion Groups community.
 
Hi Mark -

The simplest & most direct answer to your question is that 'pages' actually
_do not_
exist in a Word document. It simply tries to give the user an idea of how
many sheets of paper will be required to print the "words, paragraphs &
sections" the file does contain based on the specifications for margin
settings, line spacing, paper size, etc. If you change any of those settings,
the content reflows & may very well require a different number of 'sheets'.

HTH |:>)
 
Thanks for clearing that up, but doesn't seem too practical an idea to me.
 
Thanks - I'll look that up
--
- markvi


Kevin B said:
For great how-to tips and general programming information, check out the Word
programming forum in the Office Discussion Groups community.
 
Gee that looks easy.(?) Thanks for the solution & all the effort. I will give
it a try when I have time.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top