Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

LineFormat.InsetPen Property (Excel)

Returns or sets whether lines are drawn inside the specified shape's boundaries. Read/write

Version Added: Excel 2010

expression .InsetPen

expression A variable that represents a LineFormat object.

Return Value

msoTrue (-1) if lines are drawn inside the shape's boundaries; otherwise msoFalse (0).

The following code example adds two rectangles to the active worksheet, the first with its lines drawn inside its boundaries, and the second with its lines drawn on its boundaries.

Dim shpNew As Shape 
 
With ActiveSheet.Shapes 
 Set shpNew = .AddShape(Type:=msoShapeRectangle, _ 
 Left:=200, Top:=150, Width:=150, Height:=100) 
 With shpNew.Line 
 .Weight = 24 
 .InsetPen = msoTrue 
 End With 
 
 Set shpNew = .AddShape(Type:=msoShapeRectangle, _ 
 Left:=200, Top:=300, Width:=150, Height:=100) 
 With shpNew.Line 
 .Weight = 24 
 .InsetPen = msoFalse 
 End With 
End With
Show:
© 2015 Microsoft