我正在嘗試從 Excel 修改 Visio 中的頁面
我嘗試了這段程式碼但沒有成功:
Sub DrawMyRectangles()
Dim draw_visio As Object
Set draw_visio = CreateObject("visio.application")
Dim rect1 As Visio.Shape
Set rect1 = draw_visio.DrawRectangle(0, 0, 1, 1)
rect1.Text = "Hello World"
End Sub
請指教
答案1
請查看有關方法的更多信息繪製矩形
Set rect1 = draw_visio.ActiveWindow.Page.DrawRectangle(0, 0, 1, 1)