Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
markvi
 
Posts: n/a
Default Visual Basic question: end of Page

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?
--
- markvi
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Ed
 
Posts: n/a
Default Visual Basic question: end of Page

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

"markvi" wrote in message
...
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?
--
- markvi



  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Kevin B
 
Posts: n/a
Default Visual Basic question: end of Page

For great how-to tips and general programming information, check out the Word
programming forum in the Office Discussion Groups community.
--
Kevin Backmann


"markvi" wrote:

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?
--
- markvi

  #4   Report Post  
Posted to microsoft.public.word.docmanagement
CyberTaz
 
Posts: n/a
Default Visual Basic question: end of Page

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 |:)


"markvi" wrote:

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?
--
- markvi

  #5   Report Post  
Posted to microsoft.public.word.docmanagement
markvi
 
Posts: n/a
Default Visual Basic question: end of Page

Thanks for clearing that up, but doesn't seem too practical an idea to me.
--
- markvi


"CyberTaz" wrote:

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 |:)


"markvi" wrote:

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?
--
- markvi



  #6   Report Post  
Posted to microsoft.public.word.docmanagement
markvi
 
Posts: n/a
Default Visual Basic question: end of Page

Thanks - I'll look that up
--
- markvi


"Kevin B" wrote:

For great how-to tips and general programming information, check out the Word
programming forum in the Office Discussion Groups community.
--
Kevin Backmann


"markvi" wrote:

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?
--
- markvi

  #7   Report Post  
Posted to microsoft.public.word.docmanagement
markvi
 
Posts: n/a
Default Visual Basic question: end of Page

Gee that looks easy.(?) Thanks for the solution & all the effort. I will give
it a try when I have time.
--
- markvi


"Ed" wrote:

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

"markvi" wrote in message
...
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?
--
- markvi




Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Section Breaks - here's a test question HT New Users 7 October 16th 05 07:19 PM
Print individual page in book fold AnnetteClements Microsoft Word Help 2 July 5th 05 01:18 AM
Page Numbers Print { PAGE } in Footer in WORD even after ALT + F9 Brent Microsoft Word Help 3 June 2nd 05 05:35 PM
section breaks change each time opening document Dave Microsoft Word Help 6 March 21st 05 11:01 AM
Odd page section break Jenny Page Layout 5 December 15th 04 08:05 AM


All times are GMT +1. The time now is 03:42 PM.

Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.
Copyright 2004-2023 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"