I am having some trouble writing a macro that executes when the selection within a document changes. Any help would be appreciated.
Private Sub object_SelectionChanged(ByVal Window As IVWindow)
I attempted using ActiveDocument as the object and placing this macro in the ThisDocument module but that didn't seem to work
http://msdn.microsoft.com/en-us/library/office/aa214134%28v=office.11%29.aspx (http://msdn.microsoft.com/en-us/library/office/aa214134%28v=office.11%29.aspx)
well your first hint is that the value returned is a window, so the object should be a window.
(don't forget to instantiate it ' set m_visWin = application.activewindow )
Public WithEvents m_visWin As Visio.Window
Public Sub m_visWin_SelectionChanged(ByVal Window As IVWindow)
' do something with the event
end sub
al
where should i be instantiating it?
should i write a seperate macro to instantiate it after the document opens?
Usually it's an entry in the documentopened event handler.
al
Perfect!! Works like a charm ;D