0
在本指南https://msdn.microsoft.com/en-us/library/office/ff767482.aspx中,我能够在拖放形状时获得事件触发器。但问题是,当我收到此事件触发器时,形状位置未更新到放置位置。我的问题是,如何在删除它之后,如何获取形状的更新位置,以在Visio中对其他形状执行一些重叠检查?Visio dragDrop形状位置未更新
Dim strMessage As String
'Find out which event and event extension fired
Select Case nEventCode
Case visEvtCodeMouseMove
Dim strInfo As String
If (pSubjectObj.DragState = visMouseMoveDragStatesDrop) Then
strMessage = "MouseMove - dragDrop"
'Shape position is not updated to drop position here
End If
Case Else
strMessage = "Other (" & nEventCode & ")"
End Select
'Display the event name and the event code
If (Len(strMessage)) Then
Debug.Print strMessage
End If
端功能
嗨,感谢您的回复。 evtMouse.x和evtMouse.y似乎总是稍微偏离我选定shape的放置位置几英寸。我尝试使用ActiveWindow.Selection(1)获取选定的形状,当我通过执行来提取坐标时: Selectedshp.Cells(“PinX”)。ResultIU 它似乎给了我一个稍微偏离形状的原始放置位置的值。我放弃它后似乎无法得到形状的确切坐标。 – NiTuRen
您可能会发现该捕捉会改变实际鼠标位置下降形状的最终位置,并且该缩放级别越远,该效果将会放大或更明显。 – JohnGoldsmith