TopMargin Property

Microsoft Publisher Visual Basic

expression.TopMargin

expression    Required. An expression that returns one of the objects in the Applies To list.

Remarks

You can only use the TopMargin property when printing multiple pages on a single sheet of printer paper.

When used with the Label object, the TopMargin property is read/write only when accessed from .PageSetup.Label. Otherwise, it is read-only.

Example

This example specifies margins of a quarter of an inch between the top and left edges of the printer paper and the top and left edges of the pages in the active publication.

Sub SetTopMargin()
    With ActiveDocument.PageSetup
        .PageHeight = InchesToPoints(5)
        .PageWidth = InchesToPoints(8)
        .MultiplePagesPerSheet = True
        .TopMargin = InchesToPoints(0.25)
        .LeftMargin = InchesToPoints(0.25)
    End With
End Sub