Label.TopMargin property (Access)
Along with the LeftMargin, RightMargin, and BottomMargin properties, specifies the location of information displayed within a label control. Read/write Integer.
Syntax
expression.TopMargin
expression A variable that represents a Label object.
Remarks
A control's displayed information location is measured from the control's left, top, right, or bottom border to the left, top, right, or bottom edge of the displayed information. Setting the LeftMargin or TopMargin property to 0 places the displayed information's edge at the very left or top of the control. To use a unit of measurement different from the setting in the regional settings of Windows, specify the unit (for example, cm or in).
In Visual Basic, use a numeric expression to set the value of this property. Values are expressed in twips.
Example
The following example offsets the caption in the label EmployeeID_Label in the Purchase Orders form by 100 twips from the top of the label's border.
With Forms.Item("Purchase Orders").Controls.Item("EmployeeID_Label")
.TopMargin = 100
End With
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for