选择现有形状时出错86db089e

问题描述 投票:0回答:1

我在Visio VBA中有以下代码。它大多数时候都可以正常工作,但是当形状(pShape)是页面上第一个选择的形状时,我会收到以下错误,该错误无法被捕获

-2032465762 86db089e

Set wpage = wOwner.ContainingPage   ' Visio page with both owner and subordinate
GetSubordinates pShape, wlinks, "", 0   
' gets all subordinates of pShape into wlinks
ActiveWindow.DeselectAll  ' just in case
On Error GoTo 0
ActiveWindow.Select pShape, visSelect
On Error GoTo errtrap
ActiveWindow.Selection.Delete
vba visio
1个回答
0
投票

就在我发布之后,我看到了错误。我需要使所选页面成为当前活动页面:Application.ActiveWindow.Page = Application.ActiveDocument.Pages.Item(wpage.Name)

© www.soinside.com 2019 - 2024. All rights reserved.