Page setup
Create a new page break which is in landscape format (in between pages)
If Documents.Count > 0 Then
' The user has a document open, so insert a
' landscape section.
With Selection
' Do not accidentally over-write selected text
.Collapse Direction:=wdCollapseStart
' Insert section breaks with blank paragraphs
' in the new section.
.TypeParagraph
.Style = ActiveDocument.Styles(wdStyleNormal)
.InsertBreak Type:=wdSectionBreakNextPage
.TypeParagraph
.TypeParagraph
.TypeParagraph
.InsertBreak Type:=wdSectionBreakNextPage
.MoveUp Unit:=wdLine, Count:=3
' Set the orientation of new section to landscape.
.PageSetup.Orientation = wdOrientLandscape
' Provide guidance to the user.
.TypeText Text:="Your landscape section starts here."
End With
Else
' Tell the user what to do.
MsgBox "Please open a document and try again."
End If
Increasing page margins
If Documents.Count > 0 Then
' The user has a document open, so insert a
' landscape section.
With Selection
' Do not accidentally over-write selected text
.Collapse Direction:=wdCollapseStart
' Insert section breaks with blank paragraphs
' in the new section.
.TypeParagraph
.Style = ActiveDocument.Styles(wdStyleNormal)
.InsertBreak Type:=wdSectionBreakNextPage
.TypeParagraph
.TypeParagraph
.TypeParagraph
.InsertBreak Type:=wdSectionBreakNextPage
.MoveUp Unit:=wdLine, Count:=3
' Set the orientation of new section to landscape.
.PageSetup.Orientation = wdOrientLandscape
' Provide guidance to the user.
.TypeText Text:="Your landscape section starts here."
End With
Else
' Tell the user what to do.
MsgBox "Please open a document and try again."
End If
Increasing page margins
With ActiveDocument.PageSetup
.LeftMargin = .LeftMargin + InchesToPoints(0.5)
.RightMargin = .RightMargin + InchesToPoints(0.5)
End With
Setting the margins
With ActiveDocument.PageSetup
.LeftMargin = InchesToPoints(0.75)
.RightMargin = InchesToPoints(0.75)
.TopMargin = InchesToPoints(1.5)
.BottomMargin = InchesToPoints(1)
End With
Setting the margins
With ActiveDocument.PageSetup
.LeftMargin = InchesToPoints(0.75)
.RightMargin = InchesToPoints(0.75)
.TopMargin = InchesToPoints(1.5)
.BottomMargin = InchesToPoints(1)
End With
Comments
Post a Comment