Hi,
With the following code, I draw a hook. Manually I can chamfer the corner. But is this also possible with VBA-code?
Draw polyline using VBA
Chamfer the corner
With the following code, I draw a hook. Manually I can chamfer the corner. But is this also possible with VBA-code?
VBA Code:
Sub mrExcel()
Dim myDocument
Set myDocument = Worksheets(1)
Dim cellLeft, cellTop As Double
cellLeft = Selection.Left
cellTop = Selection.Top
Dim delta As Integer
delta = 8
Dim corner As Variant
corner = Array( _
Array(cellLeft + 3, cellTop + 29), _
Array(cellLeft + 3, cellTop + 9 + delta), _
Array(cellLeft + 3 + delta, cellTop + 9), _
Array(cellLeft + 79, cellTop + 9) _
)
Dim polylineshape As Shape
Set polylineshape = myDocument.Shapes.AddPolyline((corner))
With polylineshape.Line
.Weight = 0.75
.ForeColor.RGB = RGB(0, 0, 0)
End With
End Sub
Draw polyline using VBA
Chamfer the corner