Shape.Offset method (Visio)

Offsets a shape a specified amount.

Syntax

expression.Offset (Distance)

expression A variable that represents a Shape object.

Parameters

Name Required/Optional Data type Description
Distance Required Double Specifies the distance to offset the shape.

Return value

Nothing

Remarks

Calling the Offset method is equivalent to clicking Offset in the Microsoft Visio user interface (click Operations in the Shape Design group on the Developer tab).

For a specified line or curve, the offset is implemented as a pair of lines or curves that are equidistant from the original line or curve. Offset shapes inherit line patterns from the original shapes. They don't inherit any fill patterns or text from the original shapes.

Example

This Microsoft Visual Basic for Applications (VBA) macro shows how to use the Offset method to offset a line shape by a specified amount.

Public Sub Offset_Example() 
 
 Dim vsoShape As Visio.Shape 
 
 Set vsoShape = Application.ActiveWindow.Page.DrawLine(3, 3, 6, 6) 
 
 ActiveWindow.DeselectAll 
 ActiveWindow.Select vsoShape, visSelect 
 vsoShape.Offset(2) 
 
End Sub

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.