What event to capture when a shape changes 
Author Message
 What event to capture when a shape changes

Hi,

I need to write some VBA code that executes when a shape is changed. I have
read through the DVS manual and I made some progress (i.e., I copied the
code examples on pages 385-6 and they worked). I then created routines like
this:

Dim WithEvents pageObj As Visio.Page

Private Sub Document_DocumentOpened(ByVal doc As IVDocument)
    Set pageObj = ActivePage
End Sub

Public Sub pageObj_BeforeShapeDelete(ByVal Shape As IVShape)
    ' do something here
End Sub

Private Sub pageObj_ShapeChanged(ByVal Shape As IVShape)
    ' do something here
End Sub

The pageObj_BeforeShapeDelete routine works just fine. My thinking with
regard to pageObj_ShapeChanged is that when a shape on the page is changed,
this event would be signaled, but that does not appear to be the case.

What do I need to do to catch an event when a shape on the page changes?

Thank you!

--

Gerry Roston



Tue, 07 Oct 2003 21:25:52 GMT  
 What event to capture when a shape changes
This event only fires on a handful of 'not too often used' properties of the
shape. Refer to ShapeChanged help. Changing size of shape for example is not one
of the causes.
Quote:
-----Original Message-----
Hi,

I need to write some VBA code that executes when a shape is changed. I have
read through the DVS manual and I made some progress (i.e., I copied the
code examples on pages 385-6 and they worked). I then created routines like
this:

Dim WithEvents pageObj As Visio.Page

Private Sub Document_DocumentOpened(ByVal doc As IVDocument)
    Set pageObj = ActivePage
End Sub

Public Sub pageObj_BeforeShapeDelete(ByVal Shape As IVShape)
    ' do something here
End Sub

Private Sub pageObj_ShapeChanged(ByVal Shape As IVShape)
    ' do something here
End Sub

The pageObj_BeforeShapeDelete routine works just fine. My thinking with
regard to pageObj_ShapeChanged is that when a shape on the page is changed,
this event would be signaled, but that does not appear to be the case.

What do I need to do to catch an event when a shape on the page changes?

Thank you!

--

Gerry Roston

.



Wed, 08 Oct 2003 03:47:41 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Capturing a Shape's DoubleClick Event from VB

2. Capturing events on Shape objects in VBA

3. (Event to) Detect shape position changes

4. CAPTURING ID OF SHAPE CURRENTLY SELECTED

5. Shapes shapes shapes

6. Changing non-recurring events to yearly recurring events

7. Changing properties of a Collection with a change event :/ <--- pls help

8. Changing properties of a Collection with a change event :/ <--- pls help

9. Changing control name of button doesn't change event name to be the same

10. ComboBox Change Event Does not fire when user changes selection

11. ADO WillChangeField event: can't cancel change by changing adStatus

12. Event notification after shapes are grouped

 

 
Powered by phpBB® Forum Software