代码这样写
Dim app As New MSWord.Application
try
Dim doc = app.Documents.add
With Doc.PageSetup
.Orientation = 1 '页面方向:wdOrientPortrait--纵向,wdOrientLandscape--横向
.PageWidth = app.CentimetersToPoints(21) '纸张宽21cm
.PageHeight = app.CentimetersToPoints(29.7) '纸张高29.7cm
.TopMargin = app.CentimetersToPoints(2) '上边距2cm
.BottomMargin = app.CentimetersToPoints(1.5) '下边距1.5cm
.LeftMargin = app.CentimetersToPoints(2.5) '左边距2.5cm
.RightMargin = app.CentimetersToPoints(1.5) '右边距1.5cm
End With
catch ex As exception
msgbox(ex.message)
End try