Search notes:

Office Object Model: Word - PageSetup

The PageSetup object controls various attributes of a docuement's pages such as paper size, margins, orientation etc.
'
'  ..\..\..\runVBAFilesInOffice.vbs -word margins -c main
'

sub main()

    dim ps as pageSetup

    set ps = activeDocument.pageSetup

    ps.leftMargin   = centimetersToPoints (1  )
    ps.rightMargin  = centimetersToPoints (2  )
    ps.topMargin    = centimetersToPoints (1.5)
    ps.bottomMargin = centimetersToPoints (3.0)

    activeDocument.saved = true

end sub

Github repository about-MS-Office-object-model, path: /Word/PageSetup/margins.bas

See also

The PageSetup object of Excel.
Application.inchesToPoints etc.
Word Object Model

Index