Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.pagelayout
|
|||
|
|||
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
Posted to microsoft.public.word.pagelayout
|
|||
|
|||
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
Posted to microsoft.public.word.pagelayout
|
|||
|
|||
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
Posted to microsoft.public.word.pagelayout
|
|||
|
|||
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 | |
|
|
Similar Threads | ||||
Thread | Forum | |||
why previously formatted and used disc showing not formatted | Microsoft Word Help | |||
clear formatted pages in word '97 | New Users | |||
Embedding formatted tables in a macro | Tables | |||
Macro on all pages | Formatting Long Documents | |||
Using section breaks with formatted (styles) pages | Microsoft Word Help |