none
Incorporating landscape pages into word doc that has pre-existing template RRS feed

  • Question

  • I'm trying to figure out how to incorporate a landscape oriented template into a portrait oriented template document.
    Saturday, March 24, 2018 12:15 AM

All replies

  • Hi Blykmyk69,

    I am not really sure what you're asking.
    If you want to add a section with VBA and set it's orientation, use some code like this:

    Sub AddLandscape()
    Dim oSection As Section
    Dim oRange As Range
    
      'Define range at cursor position
      Set oRange = Selection.Range
      'Collapse range to the end of range
      oRange.Collapse direction:=wdCollapseEnd
      'Add new section to document on oRange position
      Set oSection = ActiveDocument.Sections.Add(Range:=oRange)
      'Set orientation for new section
      oSection.PageSetup.Orientation = wdOrientLandscape
      
      Set oSection = Nothing
      Set oRange = Nothing
      
    End Sub
    Hope this helps,
    Astrid

    Saturday, March 24, 2018 12:55 AM
  • Hello blymyk69,

    How do you want to incorporate these two documents?  Do you mean using pages with different orientations in the same document?

    If so, have you tried Astrid's code? The code will make document content after you are selecting in a landscape oriented, could it work for you? This is a forum for developer, do you need any code with your work?

    Best Regards,

    Terry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, March 26, 2018 5:29 AM
  • Hello,

    Has your original issue been resolved? If it has, I would suggest you mark the helpful reply as answer or provide your solution and mark as answer to close this thread. If not, please feel free to let us know your current issue.

    Best Regards,

    Terry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, March 30, 2018 8:49 AM