Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.pagelayout
EddieLampert EddieLampert is offline
external usenet poster
 
Posts: 2
Default Macro to Insert Formatted Pages

I have an Access report that I brought into word, and I want to insert two
blank pages after the first (title) page. The first inserted page (second pg
overall) I need in landscape format, and the second inserted page (third pg
overall) I need portrait, like all the other pages except #2. I can do this,
but when I record the macro for it and run it, puts the inserted pages at the
beginning, and messes up the spacing to where it adds about 10 pages to an
80pg document. Any help would be appreciated. Let me know if I should post
the code for the recorded macro. Thanks a lot.
  #2   Report Post  
Posted to microsoft.public.word.pagelayout
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Macro to Insert Formatted Pages

The following commands will insert a landscape oriented Section after the
first page of the document, leaving the rest of the document in portrait
orientation:

Dim page1 As Range
Selection.HomeKey wdStory
Set page1 = ActiveDocument.Bookmarks("\page").Range
page1.start = page1.End
page1.InsertBreak (wdSectionBreakNextPage)
page1.InsertBreak (wdSectionBreakNextPage)
ActiveDocument.Sections(2).PageSetup.Orientation = wdOrientLandscape


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

"EddieLampert" wrote in message
...
I have an Access report that I brought into word, and I want to insert two
blank pages after the first (title) page. The first inserted page (second
pg
overall) I need in landscape format, and the second inserted page (third
pg
overall) I need portrait, like all the other pages except #2. I can do
this,
but when I record the macro for it and run it, puts the inserted pages at
the
beginning, and messes up the spacing to where it adds about 10 pages to an
80pg document. Any help would be appreciated. Let me know if I should post
the code for the recorded macro. Thanks a lot.



  #3   Report Post  
Posted to microsoft.public.word.pagelayout
EddieLampert EddieLampert is offline
external usenet poster
 
Posts: 2
Default Macro to Insert Formatted Pages

Thanks, Doug. That code works fine, but when I change it to add another blank
page in portrait view, it adds two additional pages, instead of one. Again,
my goal is to add after the first page one landscape and one portrait, both
blank. Any help is appreciated.

"Doug Robbins - Word MVP" wrote:

The following commands will insert a landscape oriented Section after the
first page of the document, leaving the rest of the document in portrait
orientation:

Dim page1 As Range
Selection.HomeKey wdStory
Set page1 = ActiveDocument.Bookmarks("\page").Range
page1.start = page1.End
page1.InsertBreak (wdSectionBreakNextPage)
page1.InsertBreak (wdSectionBreakNextPage)
ActiveDocument.Sections(2).PageSetup.Orientation = wdOrientLandscape


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

"EddieLampert" wrote in message
...
I have an Access report that I brought into word, and I want to insert two
blank pages after the first (title) page. The first inserted page (second
pg
overall) I need in landscape format, and the second inserted page (third
pg
overall) I need portrait, like all the other pages except #2. I can do
this,
but when I record the macro for it and run it, puts the inserted pages at
the
beginning, and messes up the spacing to where it adds about 10 pages to an
80pg document. Any help would be appreciated. Let me know if I should post
the code for the recorded macro. Thanks a lot.




  #4   Report Post  
Posted to microsoft.public.word.pagelayout
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Macro to Insert Formatted Pages

Use

Dim page1 As Range
Selection.HomeKey wdStory
Set page1 = ActiveDocument.Bookmarks("\page").Range
page1.start = page1.End
page1.InsertBreak (wdSectionBreakNextPage)
page1.InsertBreak (wdSectionBreakNextPage)
page1.InsertBreak
ActiveDocument.Sections(2).PageSetup.Orientation = wdOrientLandscape

That will insert two blank pages between the first page and what was
originally the second page with the first of the new pages in landscape
orientation and the second new page in portrait orientation.

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

"EddieLampert" wrote in message
...
Thanks, Doug. That code works fine, but when I change it to add another
blank
page in portrait view, it adds two additional pages, instead of one.
Again,
my goal is to add after the first page one landscape and one portrait,
both
blank. Any help is appreciated.

"Doug Robbins - Word MVP" wrote:

The following commands will insert a landscape oriented Section after the
first page of the document, leaving the rest of the document in portrait
orientation:

Dim page1 As Range
Selection.HomeKey wdStory
Set page1 = ActiveDocument.Bookmarks("\page").Range
page1.start = page1.End
page1.InsertBreak (wdSectionBreakNextPage)
page1.InsertBreak (wdSectionBreakNextPage)
ActiveDocument.Sections(2).PageSetup.Orientation = wdOrientLandscape


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

"EddieLampert" wrote in message
...
I have an Access report that I brought into word, and I want to insert
two
blank pages after the first (title) page. The first inserted page
(second
pg
overall) I need in landscape format, and the second inserted page
(third
pg
overall) I need portrait, like all the other pages except #2. I can do
this,
but when I record the macro for it and run it, puts the inserted pages
at
the
beginning, and messes up the spacing to where it adds about 10 pages to
an
80pg document. Any help would be appreciated. Let me know if I should
post
the code for the recorded macro. Thanks a lot.






Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
why previously formatted and used disc showing not formatted BooBear Microsoft Word Help 1 July 11th 06 09:03 PM
clear formatted pages in word '97 John S M New Users 1 December 20th 05 11:43 PM
Embedding formatted tables in a macro Jerry Tables 3 October 12th 05 04:25 AM
Macro on all pages Mary Z Formatting Long Documents 7 May 11th 05 11:18 PM
Using section breaks with formatted (styles) pages misscoleen Microsoft Word Help 1 January 7th 05 03:49 AM


All times are GMT +1. The time now is 07:56 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"