使用VBA更改单词2013中画布内部形状的位置

时间:2018-02-28 06:42:11

标签: vba canvas word-vba shapes

我在Microsoft Word 2013中的画布中创建了一个形状(矩形),其中Left:= 100 但是当我读到形状的左边属性时,我得到的数字与我在创建阶段设置的数字不同!

Sub DRTEXT()
  Dim shp1 As Shape, shpCanvas As Shape
Set shpCanvas = ActiveDocument.Shapes.AddCanvas(Left:=0, Top:=0, Width:=400, Height:=400)
Set shp1 = shpCanvas.CanvasItems.AddShape(Type:=msoShapeRectangle, _
        Left:=100, Top:=100, Width:=100, Height:=100)


      MsgBox shp1.Left '(shows the number 5!)
      shp1.Left = 200
      MsgBox shp1.Left
End Sub

我觉得这可能是画布里面的形状,不会让我按照我的意愿移动形状。 有线索吗? 非常感谢

0 个答案:

没有答案