Re-Direct "NEW" Button using VBA

Re-Direct "NEW" Button using VBA

isocam
Collaborator Collaborator
444 Views
1 Reply
Message 1 of 2

Re-Direct "NEW" Button using VBA

isocam
Collaborator
Collaborator

Can anybody answer this question?

 

I have a vba macro that runs every time the "SAVE" button is pressed. This works exactly as I requre!!!

 

I need another macro that can run whenever the "NEW" button is pressed.

 

Is it possible??

 

For example,

 

Instead of showing the "pop-up box" with the various templates etc, can I (FOR EXAMPLE ONLY) show a message box every time the "NEW" Button is pressed, and therefore bypass the "pop-up box"

 

Many thanks in advance!!!!

0 Likes
445 Views
1 Reply
Reply (1)
Message 2 of 2

adam.nagy
Autodesk Support
Autodesk Support

Hi,

 

You could simply listen to the OnFileNewDialog event of FileUIEvents (under the Application class) and then say that you handled the event, and provide your own implementation instead:

Private Sub OnFileNewDialog(ByVal TemplateDir As String, ByVal ParentHWND As Long, TemplateFileName As String, ByVal Context As NameValueMap, HandlingCode As HandlingCodeEnum)
    HandlingCode = kEventHandled
End Sub

I hope this helps.

 

Cheers, 



Adam Nagy
Autodesk Platform Services
0 Likes