Insert Landscape Page

D

Debra Ann

I need to create a macro that inserts a page break after the current page
(which could or could not be the last page) and creates a landscape page.
The problem is I don't know how to test for where the user will be in the
document.

Is there a code that goes to the bottom of the current page?
Is there a code that once you go to the bottom that it can test to see if
you are at the end of the document?

I've wasted a day trying to figure this out and was hoping someone could
help me.

Thanks in advance.
 
D

Doug Robbins - Word MVP

The following will display a message box telling you if you are at the end
of the document and leave the cursor before the final paragraph mark if you
are at the end of the document or before the first character on the next
page if you are not at the end of the document:

Dim myrange as Range
Set myrange = Selection.Bookmarks("\page").Range
myrange.Start = myrange.End - 1
myrange.Select
Selection.Collapse wdCollapseEnd
If Selection.Range.End < ActiveDocument.Range.End - 1 Then
MsgBox "You are not at the end of the document"
Else
MsgBox "You are at the end of the document"
End If


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

Debra Ann

Doug:

Sorry I got sidetracked with another project at work and had to set this one
aside. I just noticed your reply. I will try it. Thanks for your help.
 

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