Message 1 of 2
Macros on Start up

Not applicable
06-18-2003
07:46 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all
How do I automaticaly start a macro that sets up my events when inventor
starts.
The macro below is in my default.ivb file and when I start inventor
I want it to start as well.
Public Sub Setup_events()
On Error Resume Next
'attach to Inventor
Set IvApp = GetObject(, "Inventor.Application")
'if Inventor isn't running, start it
If Err Then
Err.Clear
Set IvApp = CreateObject("Inventor.Application")
End If
IvApp.Visible = True
If IvApp.Documents.Count > 0 Then
Set DocEvents = IvApp.ActiveDocument.DocumentEvents
End If
On Error GoTo 0
Set AppEvents = IvApp.ApplicationEvents
'Set FileAccessEvents = IvApp.FileAccessEvents
Set UserInputEvents = IvApp.CommandManager.UserInputEvents
'etc.......
end sub
How do I automaticaly start a macro that sets up my events when inventor
starts.
The macro below is in my default.ivb file and when I start inventor
I want it to start as well.
Public Sub Setup_events()
On Error Resume Next
'attach to Inventor
Set IvApp = GetObject(, "Inventor.Application")
'if Inventor isn't running, start it
If Err Then
Err.Clear
Set IvApp = CreateObject("Inventor.Application")
End If
IvApp.Visible = True
If IvApp.Documents.Count > 0 Then
Set DocEvents = IvApp.ActiveDocument.DocumentEvents
End If
On Error GoTo 0
Set AppEvents = IvApp.ApplicationEvents
'Set FileAccessEvents = IvApp.FileAccessEvents
Set UserInputEvents = IvApp.CommandManager.UserInputEvents
'etc.......
end sub