Table of contents
Collapse the table of content
Expand the table of content

WrapFormat.DistanceAuto Property (Publisher)

office 365 dev account|Last Updated: 8/24/2017
3 Contributors

Returns or sets an MsoTriState constant indicating whether an appropriate distance between an inline shape and any surrounding text is automatically calculated. Read/write.


expression. DistanceAuto

_expression_A variable that represents a WrapFormat object.

Return Value



The DistanceAuto property value can be one of the MsoTriState constants declared in the Microsoft Office type library and shown in the following table.

msoFalseThe shape's edges are not adjusted depending on the margins of the text box it overlaps.
msoTriStateMixedReturn value indicating a combination of msoTrue and msoFalse for the specified shape range.
msoTriStateToggleSet value that switches the property value between msoTrue and msoFalse.
msoTrueThe default. The shape's edges are automatically adjusted depending on the margins of the text box it overlaps.


The following example sets shape one on page one of the active publication so that its edges are not automatically adjusted based on its distance from surrounding text.

Sub SetDistanceAutoProperty() 
 With ActiveDocument.Pages(1).Shapes(1).TextWrap 
 .Type = pbWrapTypeSquare 
 .DistanceAuto = msoFalse 
 End With 
End Sub
© 2018 Microsoft