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 / February 2006

Tip: Looking for answers? Try searching our database.

How does macro know it has gone to next page

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sukhi - 21 Feb 2006 13:28 GMT
I have VB program writing various paragraphs.
On top of every new page, my program needs type something like '...Continued'

How would my macro know that it has gone on to new page or can I do it some
other way, ie. include it in template, but how?
Cooz - 21 Feb 2006 13:48 GMT
Hi Sukhi,

Open your document.
Choose File | Page Setup... | tab Layout
Check "Different first page"
Click OK
If your document has only one page, go to the end of the document and press
Ctrl-Enter to insert a page break.
Choose View | Header and Footer
Type ...Continued
Close the Header (and Footer)
If you inserted a page break to obtain a second page, press Backspace to
delete it now.
Save your document.

...Continued will automatically appear on the top of all pages, except the
first.

Success,
Cooz
Signature

PS: If this is a satisfying answer to your question and you're logged in via
the Microsoft site, please click Yes to "Did this post answer the question?".
Thanks.

> I have VB program writing various paragraphs.
> On top of every new page, my program needs type something like '...Continued'
>
> How would my macro know that it has gone on to new page or can I do it some
> other way, ie. include it in template, but how?
Sukhi - 21 Feb 2006 14:01 GMT
Cooz
I have range object (inside table), that inserts paragraphs, tables so on.  
I want to insert 'Continued' when my range object moves on to next page, not
necessarily when the document moves to next page.

My range object is in the middle of page and there is some static text at
the bottom of the page.

may be checking for - -
rBMRange.information(wdActiveEndPageNumber) will do, but do I have to keep
on checking after each insert. that would not work.

> Hi Sukhi,
>
[quoted text clipped - 22 lines]
> > How would my macro know that it has gone on to new page or can I do it some
> > other way, ie. include it in template, but how?
Doug Robbins - Word MVP - 21 Feb 2006 18:58 GMT
Pages in Word do not mean much as the pagination can vary depending upon the
active printer.

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

> Cooz
> I have range object (inside table), that inserts paragraphs, tables so on.
[quoted text clipped - 39 lines]
>> > some
>> > other way, ie. include it in template, but how?
Cooz - 23 Feb 2006 08:51 GMT
Hi Sukhi,

... and if the entire range moves to the next page "Continued..." will have
to disappear, I guess. Well, this can be done.

Place a bookmark at the beginning of the range (say, "StartR").
Place a bookmark at the end of the range (say, "EndR").
Activate the header.
Insert the following field (by pressing Ctrl-F9 to insert the { } and typing
the rest):

{ IF s < e { IF { PAGE } <= e { IF s < { PAGE } "Continued..." } } }

Choose Insert | Reference > Cross-reference...
In the dialog, choose 'Bookmark' as Reference type, end choose 'Page number'
under 'Insert reference to:'
Now, replace s in the field by a cross-reference to StartR, and replace e by
a cross-reference to EndR.
Done.

"Continued..." appears on the current page whenever the 'StartR-page' comes
before the 'EndR-page' AND the current page is either the 'EndR-page' or
comes before it, AND the 'StartR-page' comes before the current page. The
last AND-phrase prevents "Continued..." to appear on pages before the
'StartR-page'.

Thanks to a few nightly hours in which sleep wouldn't come. :-)

Success,
Cooz
--
PS: If this is a satisfying answer to your question and you're logged in via
the Microsoft site, please click Yes to "Did this post answer the question?".
Thanks.

> Cooz
> I have range object (inside table), that inserts paragraphs, tables so on.  
[quoted text clipped - 34 lines]
> > > How would my macro know that it has gone on to new page or can I do it some
> > > other way, ie. include it in template, but how?
 
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.