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

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/Microsof...', 1742027080, '3.145.91.233', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/Microsoft/Office/Word/Object-Model/PageSetup/index(65): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78