How to catch the FileUIEvents events

How to catch the FileUIEvents events

Anonymous
Not applicable
692 Views
6 Replies
Message 1 of 7

How to catch the FileUIEvents events

Anonymous
Not applicable
Hi,

I can't get the FileUIEvents_OnFileSaveAsDialog to work, this event should
be fired before a Save Copy As if understand the help correctly. My add-in
must be activated when a Save Copy As is made so I can catch the Save Copy
As FileName.

All other events works just fine, are there any limitation in combining all
the events in a add-in? or have I missed something?

-Patrick
0 Likes
693 Views
6 Replies
Replies (6)
Message 2 of 7

Anonymous
Not applicable
Patrick try this:
'declarations
Private WithEvents FileUIEvents As FileUIEvents
Private OnFileSaveAsDialog As Boolean
'this goes on form
Set FileUIEvents = IvApp.FileUIEvents
OnFileSaveAsDialog = True
Private Sub FileUIEvents_OnFileSaveAsDialog(FileTypes() As String, ByVal SaveCopyAs As Boolean, _
ByVal ParentHWND As Long, FileName As String, HandlingCode As Inventor.HandlingCodeEnum)
If OnFileSaveAsDialog = true Then
Debug.Print "Saveas Dialog box is opening now"
End If
End Sub

Mike@RTSWright
0 Likes
Message 3 of 7

Anonymous
Not applicable
Thanks Mike,

 

It was late and I just missed the statement "Set FileUIEvents
= IvApp.FileUIEvents" that did it.

 

The next problem is that the event is fired before the
event so the FileName is empty, I had hope the event would give the "save
copy as" filename.

 

A wish would be to have the timing Boolean "BeforeOrAfter
As Inventor.EventTimingEnum" to return the filename on the "After"
timing.

 

I've tried much with Neil Munro's Command Event example
(big thanks for sharing) but it doesn't seen to catch this filename in
any of the other events.

 


Does anyone have an idea to get the "save
copy as" filename?

 

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Patrick
try this:
'declarations
Private WithEvents FileUIEvents As
FileUIEvents
Private OnFileSaveAsDialog As Boolean
'this goes on form

Set FileUIEvents = IvApp.FileUIEvents
OnFileSaveAsDialog = True

Private Sub FileUIEvents_OnFileSaveAsDialog(FileTypes() As String, ByVal
SaveCopyAs As Boolean, _
ByVal ParentHWND As Long, FileName As String,
HandlingCode As Inventor.HandlingCodeEnum)
    If
OnFileSaveAsDialog = true Then

        Debug.Print "Saveas Dialog
box is opening now"
    End If
End Sub

Mike@RTSWright

0 Likes
Message 4 of 7

Anonymous
Not applicable
Patrick,

Have you tried the "OnSave" or OnSaveDocument command event? Mike
0 Likes
Message 5 of 7

Anonymous
Not applicable
Yes and I've not had the luck to make any of the other events to
return the "save copy as" filename. Any clues API team??

 

-Patrick


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Patrick,

Have you tried the "OnSave" or OnSaveDocument command event?
Mike

0 Likes
Message 6 of 7

Anonymous
Not applicable
Patrick,

Are you looking for the new filename your creating? Mike
0 Likes
Message 7 of 7

Anonymous
Not applicable
Yes.


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Patrick,

Are you looking for the new filename your creating?
Mike

0 Likes