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 2006

Tip: Looking for answers? Try searching our database.

page/section break and text boxes

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JohnF - 25 Nov 2006 18:31 GMT
I am doing a template for a client which consists of 4 master pages, which
are selected via a button on the toolbar. To cut a long story short I've had
to use text boxes, but I have now discovered that new page/section doesn't
work in text boxes.

As the button to insert new page runs a subroutine I can program anything in
front of the new page command to get the focus off the text box.

The only problem I have is I am not that experienced a programmer to achieve
this.

How do I get the focus back into the main thread of the document, preferably
at the end so that the new page inserts after the current and not before.

Any help would be appreciated.
TIA
Doug Robbins - Word MVP - 25 Nov 2006 21:00 GMT
Probably better if you gave us the long story of just why you had to use
text boxes.

However, to answer your specific question

Set myrange = ActiveDocument.Range
With myrange
   .Collapse Direction:=wdCollapseEnd
   .InsertBreak Type:=wdPageBreak
End With

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 am doing a template for a client which consists of 4 master pages, which
> are selected via a button on the toolbar. To cut a long story short I've
[quoted text clipped - 16 lines]
> Any help would be appreciated.
> TIA
Alex St-Pierre - 26 Nov 2006 02:26 GMT
Thanks for your answer. Since the project will be used by a lot of people, I
have a procedure that open Word references at the opening of the excel file
and close the reference before the close of the excel file. To modify the
reference, it required that the user has clicked the security option:
confident with visual basic project. I don't know if it possible to make a
.inf that modification the registration key of Excel?

>1) Instead of setting up the styles every time, better is to create a
>template that already has the styles you want, then create your document
>based on that template.
My problem is that the program will be used by a lot of people around
different office. It will be hard to put a template on a server with the same
path.

>2) Don't use the Selection object. Do everything with Ranges.
How can I go paragraph to paragraph without using selection?

>4) If you're using early binding, don't use late binding to instantiate Word
Yes, I'll use early binding and use directly Set WordApp = Word.Application

Thanks!
Alex
Signature

Alex St-Pierre

> I am doing a template for a client which consists of 4 master pages, which
> are selected via a button on the toolbar. To cut a long story short I've had
[quoted text clipped - 12 lines]
> Any help would be appreciated.
> TIA
Alex St-Pierre - 26 Nov 2006 02:47 GMT
Sorry, I posted my message on the wrong post.
Alex
Signature

Alex St-Pierre

> Thanks for your answer. Since the project will be used by a lot of people, I
> have a procedure that open Word references at the opening of the excel file
[quoted text clipped - 35 lines]
> > Any help would be appreciated.
> > TIA

Rate this thread:






 
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.