Message 1 of 2
why this event no work?

Not applicable
06-06-2002
01:16 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
in the thisdrawing module a2ki
Option Explicit
Public WithEvents AcadApp As AcadApplication
Public WithEvents AcadDoc As AcadDocument
Sub acaddoc_activate()
Set AcadApp = Application
Set AcadDoc = AcadApp.ActiveDocument
MsgBox AcadApp.ActiveDocument.Name
End Sub
Sub acadapp_appactivate()
Set AcadApp = Application
Debug.Print AcadApp.ActiveDocument.Name
MsgBox AcadApp.ActiveDocument.Name
End Sub
I thought, foolishly that this would report every time I change document,
but it only fires when entering and leaving the one in which the sub was
begun, except for once when it fired after changing a doc and then changing
app. but usually it only reports "Drawing1", even though I'm switching
between "Drawing1" and "whatever".
after a few test runs with this and variations thereof memory gets bunged up
and acad crashes.
still mystified at events
Mark
Option Explicit
Public WithEvents AcadApp As AcadApplication
Public WithEvents AcadDoc As AcadDocument
Sub acaddoc_activate()
Set AcadApp = Application
Set AcadDoc = AcadApp.ActiveDocument
MsgBox AcadApp.ActiveDocument.Name
End Sub
Sub acadapp_appactivate()
Set AcadApp = Application
Debug.Print AcadApp.ActiveDocument.Name
MsgBox AcadApp.ActiveDocument.Name
End Sub
I thought, foolishly that this would report every time I change document,
but it only fires when entering and leaving the one in which the sub was
begun, except for once when it fired after changing a doc and then changing
app. but usually it only reports "Drawing1", even though I'm switching
between "Drawing1" and "whatever".
after a few test runs with this and variations thereof memory gets bunged up
and acad crashes.
still mystified at events
Mark