Google Answers Logo
View Question
 
Q: Insert landscape page from file with Word macro ( No Answer,   0 Comments )
Question  
Subject: Insert landscape page from file with Word macro
Category: Computers > Programming
Asked by: peterd-ga
List Price: $30.00
Posted: 01 Jun 2004 20:47 PDT
Expires: 23 Jun 2004 00:22 PDT
Question ID: 355097
Hello,
I need a macro that inserts a landscape page file onto a main portrait
document report.

The inserted landscape page uses different headers and footers, so I
need the headers and footers not linked the previous and following
pages.
The user should simpley click on a page somewhere in the document and
click a ?Insert landscape? button which I will assign to the macro you
provide. It will then insert this landscape document at the bottom of
the currrent page that the cursor is on. It would be good to check if
the user has the cursor on the first page and if so then the macro
should msgbox and warn the user that they cannot insert the landscape
document here and exit the procedure.

The landscape file is located at ?g:\apps\InfoBank\Shared
Templates\LANDSCAPE.doc? on the users pc. The landscape file to be
imported contains ?fake? portrait headers and footers, that is they
are just textboxes aligned to the LHS and RHS, so I just need the
headers and footers unlinked from the previous pages on the main
document.

It seemed to be workign but now it isnt. Here is my code that ?should? do it.

  Application.ScreenUpdating = False
    
    Selection.InsertBreak Type:=wdSectionBreakNextPage
Selection.InsertBreak Type:=wdSectionBreakNextPage
Selection.MoveUp Unit:=wdLine, Count:=1
    With Selection.PageSetup
        .LineNumbering.Active = False
        .Orientation = wdOrientLandscape
        .SectionStart = wdSectionNewPage
        .OddAndEvenPagesHeaderFooter = False
    End With
    
    ActiveDocument.Sections(Selection.Information(wdActiveEndSectionNumber)).Headers(wdHeaderFooterPrimary).LinkToPrevious
= False
    ActiveDocument.Sections(Selection.Information(wdActiveEndSectionNumber)).Footers(wdHeaderFooterPrimary).LinkToPrevious
= False

    ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
    Selection.InsertFile FileName:="g:\apps\InfoBank\Shared
Templates\LANDSCAPE.doc", Range:="", _
    ConfirmConversions:=False, Link:=False, Attachment:=False
    
    With Selection.PageSetup
        .LineNumbering.Active = False
        .Orientation = wdOrientPortrait
        .SectionStart = wdSectionNewPage
        .OddAndEvenPagesHeaderFooter = False
        .DifferentFirstPageHeaderFooter = False
        .VerticalAlignment = wdAlignVerticalTop
    End With


Thanks
Peter.
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy