.NET

Reply
Valued Contributor
Posts: 50
Registered: ‎12-15-2009
Message 1 of 5 (349 Views)
Accepted Solution

Running Macro from Ribbon button

349 Views, 4 Replies
06-21-2012 08:03 AM

Hi

I have created a ribbonbar in autocad 2012 using API and  c#.

On ribbon button i am executing a Command method which display a wizard for copying some files.

now i want to run a macro before excuting the ribbon button command methood.

which display a messagebox with yes and no 

if user click yes command method will excutes itself and display wizard for copy files

if user click no command method will not execute and return.

 

this will allow user to use macro for customizing the file copy process.

 

can some body help how i can achive this.

 

thanks a lot.

 

Distinguished Contributor
Posts: 701
Registered: ‎01-24-2003
Message 2 of 5 (342 Views)

Re: Running Macro from Ribbon button

06-21-2012 09:45 AM in reply to: mnav

Here's some info on prompting the user.

Valued Contributor
Posts: 50
Registered: ‎12-15-2009
Message 3 of 5 (329 Views)

Re: Running Macro from Ribbon button

06-21-2012 12:31 PM in reply to: mnav

thanks for your reply but i want to run a macro not the editor prompt.  i want to run a macro which decide to continue with command of abort it.

 

any help how to run and macro from ribbon button and abort button command if you dont want to continue.#

 

thanks

 

Valued Contributor
Posts: 50
Registered: ‎12-15-2009
Message 4 of 5 (314 Views)

Re: Running Macro from Ribbon button

06-22-2012 01:16 AM in reply to: mnav

Got it..... here is the code if somebody looking for it

 

AcadApplication.RunMacro(@"C:\Test\AutocadVBA\NavTest.dvb!Module1.navTest");

 

thanks

Distinguished Contributor
Posts: 701
Registered: ‎01-24-2003
Message 5 of 5 (294 Views)

Re: Running Macro from Ribbon button

06-25-2012 07:23 AM in reply to: mnav

Sorry, I misunderstood what you wanted. Your question sounded like you wanted the menu macro to prompt the user. You didn't ask on how to run a vba macro.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you interested in helping shape the Autodesk Community?
We’re looking at a few different ways to improve the “All Forums” landing page and need your feedback! If interested, please take a few minutes to fill out the following Usability Study. Thank you for your time!

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community