Another Problem when VBA is in the Stencil (instead of Document)

M

mikeFin

Hello!

As in my previous post some days ago, I have again a problem, having some
VBA-code running correctly when it is in a stencil (it works well when it is
in the "ThisDocument" of the Document, but not when in the ThisDocument of
the stencil).

Here is the code:

- - -

Private Sub Document_PageAdded(ByVal Page As IVPage)

MsgBox "myText"

End Sub

- - -

Thanks in advance!

Nicolas
 
M

mikeFin

I have read in the SDK about addadvise now.
I didn't understood everything written there yet, but I managed to make my
code work when it should.

Thanks for the advice and telling me where to look!
 
A

AlEdlund

The default for the event sink demo usually used the parent document for
where the eventlist lives, when you create the pair (addadvise/event sink)
of modules make sure you seed it with the drawing document, not the stencil
document, so the correct events are captured.
al
ps that's probably why it worked when in the parent and failed in the
stencil
 
Top