首页 > 解决方案 > 如何调整弯头连接器的宽度?

问题描述

请注意,在以下代码中,arw 表示从形状底部突出的箭头。对于需要做出决定的情况,我还创建了一个侧箭头(在代码中标识为 Sarw)。请注意,对于侧箭头,我将其指定为连接器。我这样做是因为我没有看到一条线上有一个调整,因为弯头连接器上有一个。当我尝试在我的代码中调整弯头连接器的宽度时,我没有成功。我不懂为什么。任何可以提供的帮助将不胜感激。谢谢!

 'This first part places arrows on the bottom of a shape

 If rng.Offset(, 4).Value = " "
 GoTo Line1 'I wrote this part for when VBA expects a number & gets a blank
 End If

 Set arw = ws2.Shapes.AddLine(BegX, BegY, EndX, EndY)
 With arw
     .Line.BeginArrowheadStyle = msoArrowheadTriangle
     .Line.BeginArrowheadWidth = msoArrowheadWide
     .Line.ForeColor.RGB = RGB(0, 0, 0)

 End With


 'The following part is for the side arrows
 If rng.Offset(, 8).Value = " " Then
 GoTo Line2

 End If
 Set Sarw = ws2.Shapes.AddConnector(msoConnectorElbow, SBegX, SBegY, SEndX, SEndY)

 With Sarw

     .Line.BeginArrowheadStyle = msoArrowheadTriangle
     .Line.BeginArrowheadWidth = msoArrowheadWide
     .Line.ForeColor.RGB = RGB(0, 0, 0)
     .Adjustments.Item(1) = 45

 End With

标签: vbaexcellinearrows

解决方案


SJR ...我试过你的方法。除非我有误解,否则这似乎是为了调整线条的粗细。请注意,如果您要将权重从 5 更改为 90,则该线看起来更像一个矩形。我附上一张图来展示我所瞄准的效果。我希望这有帮助。如果我误解了你的例子,请告诉我。谢谢!

点击这里例如


推荐阅读