I create protected word template forms for my company. Frequently, I have to
create a form that adds additional pages. I generally record the process
(macro) to determine what I want to happen then go in and clean up the code.
The process I use is ctrl end, ctrl enter, which gets me to the bottom of the
page and the code looks like this:
Selection.EndKey Unit:=wdStory
Selection.InsertBreak Type:=wdPageBreak
If there are pages inbetween, using this jumps over pages to go to the end
of the document... first question: is this what the wdStory is telling me?
Is there a way, without a physical bookmark, to go to the bottom of any
page? Regards - Lenny
Hi Lenny,
>If there are pages inbetween, using this jumps over pages to go to the end
>of the document... first question: is this what the wdStory is telling me?
yes.
>Is there a way, without a physical bookmark, to go to the bottom of any
>page?
Sub Test441()
Selection.Bookmarks("\page").Select
Selection.MoveEnd unit:=wdCharacter, Count:=-1
Selection.Collapse Direction:=wdCollapseEnd
End Sub
--
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
Vista Small Business, Office XP
Lenny - 20 May 2008 18:35 GMT
Helmut: Greetings from California, USA!
Do I assume there needs to be a paragraph mark at the bottom of the page?
Most of the forms I develop of this type are based on tables. There is
usually a table cell at the bottom of the page. Below the cell, I leave room
for a paragraph mark, which I use as a jumping off point to insert a Section
Break New Page, which gives me the next page in the series. Does your sample
code do the same?
> Hi Lenny,
>
[quoted text clipped - 19 lines]
>
> Vista Small Business, Office XP
Helmut Weber - 21 May 2008 16:04 GMT
Hi Lenny,
>Do I assume there needs to be a paragraph mark at the bottom of the page?
No, doesn't matter.
>Most of the forms I develop of this type are based on tables. There is
>usually a table cell at the bottom of the page. Below the cell, I leave room
>for a paragraph mark, which I use as a jumping off point to insert a Section
>Break New Page, which gives me the next page in the series.
If there is a paragaph mark at the end of a page,
the cursor will be placed before the paragraph mark.
--
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
Vista Small Business, Office XP
Lenny - 21 May 2008 16:57 GMT
Helmut: many thanks for your assistance
Lenny - "all questions are learning opportunities"
> Hi Lenny,
>
[quoted text clipped - 16 lines]
>
> Vista Small Business, Office XP