page/section break and text boxes

J

JohnF

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
 
D

Doug Robbins - Word MVP

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


--
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
 
A

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

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

Top