LeftMargin property

Microsoft Visio Developer Reference

LeftMargin property

   Example   

Specifies the left margin, which is used when printing.

Version added

4.0

Syntax

retVal =object.LeftMargin([unitsNameOrCode])
object.LeftMargin([unitsNameOrCode]) = newValue

retVal

Double. The margin value expressed in the given units.

object

Required. An expression that returns a Document object.

unitsNameOrCode

Optional Variant. The units to use when retrieving or setting the margin value. Defaults to internal drawing units.

newValue

Required Double. The new margin value.

Remarks

The LeftMargin property corresponds to the Left setting in the Print Setup dialog box (on the File menu, click Page Setup, click the Print Setup tab, and then click Setup).

You can specify unitsNameOrCode as an integer or a string value. If the string is invalid, an error is generated. For example, the following statements all set unitsNameOrCode to inches.

Cell.LeftMargin(visInches) = newValue

Cell.LeftMargin (65) = newValue

Cell.LeftMargin ("in") = newValue where "in" can also be any of the alternate strings representing inches, such as "inch", "in.", or "i".

For a complete list of valid unit strings along with corresponding Automation constants (integer values), see About units of measure.

Automation constants for representing units are declared by the Visio type library in member VisUnitCodes.