0
我有一個外部過程,它向Publisher頁面添加了很多形狀。可悲的是,一些形狀已放置在頁面之外。如何使用VBA在發佈器中獲取形狀,當它位於頁面外部時?
此形狀不在該頁面的Shapes集合中。任何人都知道我能從哪裏得到它們?
這裏說的複製問題示例代碼:
Sub main()
Dim oPage As Page
Dim oTable As Table
Dim oBox As Shape
Dim oLine As Shape
Set oPage = ActiveDocument.Pages(1)
Set oBox = oPage.Shapes.AddTable(2, 1, -150, 50, 120, 30, False)
oBox.Name = "Pepe"
Set oBox = oPage.Shapes.AddTable(2, 1, 350, 150, 120, 30, False)
oBox.Name = "Pepa"
Set oLine = oPage.Shapes.AddConnector(msoConnectorElbow, 0, 0, 100, 100)
With oLine.ConnectorFormat
.BeginConnect oPage.Shapes.Item("Pepe"), 1 'here are the error!!!
.EndConnect oPage.Shapes.Item("Pepa"), 1
End With
End Sub
我想是讓Shapes.Item(「佩佩」)的頁面是不是即使(左-150)。哪些形狀不在頁面中?
在此先感謝。
天使。
可能重複的[通過Id或名稱獲取形狀](http://stackoverflow.com/questions/5527073/get-shape-by-id-or-name) –