Jump to content
Macro Express Forums

Can we create mutiple choice menu with user inputs


sunilvedula
 Share

Recommended Posts

Hi All,

 

I have a strange request from one of my department members. They want me to create a macro which would be used by anyone irrespective of the department or anything. What I understand is they want a macro which will prompt the user to input the variable and it will create the multiple choices menu or boxes based on the input and create a macro based on the input received.

 

I am trying to be clear. Let me give an example. When we start this macro it should prompt like: “How many boxes do you need in the first screen?”. If user gives 5 it should take the input and be able to create 5 boxes or multiple choice menu and then should prompt for the text for those 5 boxes and those should become the headings for those. It goes on creating like that until click cancel. Now the macro should save the macro with the inputs and that should become a new macro which can be used by others.

 

The idea is if we create a sample macro like this it will not require us to create macros for every other department but just pass on this sample file and every department people based on their requirement will create from this file and start using the new created macro file.

 

I know this a strange request (at least for me) and if anyone has any ideas please suggest and also if this is possible or not.

Link to comment
Share on other sites

It does sound strange. Maybe they want each person to be able to construct his own menu structure on his PC, to enable him to quickly get to various applications? If so, then the macro you write would need to associate some logic with each menu choice, for example, Launch Notepad.

 

I don't know how to do it, but take a look at Run Macro in Variable and Load Macro Text File -- maybe there's something there to help. I'm thinking you might write a generalized menu macro that will then be loaded, modified, and saved by the interactive macro accessible to the users. Just thinking out loud here ....

Link to comment
Share on other sites

You can build a very simple menu structure using Notepad.

First make file menu.bat, which is a sequence of statements like

cls

echo *** MENU ***

echo 1 Notepad

echo 2 MS Word

echo 3 Excel

etc.

All this is, is a series of reminders to the user. So when he opens a DOS command window and types "menu" he sees the list. (Or, you give him a desktop icon to run menu.bat.)

 

Then, if the user wants Excel, he types "3".

 

You make file 3.bat which consists simply of

start c:\Program Files\ .... \excel.exe

exit

 

Same for the other options. 1.bat runs Notepad, 2.bat runs Word, etc.

 

Now instead of you manually building all these .bat files, you could write an interactive macro that asks the user what he wants, then builds the .bat files using Variable Modify String [Append to Text File]. Use Variable Set String [set String from File Name (Prompt)] to allow the user to drill down to the file he wants to run for each menu option.

Link to comment
Share on other sites

Hi All,

 

I have a strange request from one of my department members. They want me to create a macro which would be used by anyone irrespective of the department or anything. What I understand is they want a macro which will prompt the user to input the variable and it will create the multiple choices menu or boxes based on the input and create a macro based on the input received.

 

I am trying to be clear. Let me give an example. When we start this macro it should prompt like: “How many boxes do you need in the first screen?”. If user gives 5 it should take the input and be able to create 5 boxes or multiple choice menu and then should prompt for the text for those 5 boxes and those should become the headings for those. It goes on creating like that until click cancel. Now the macro should save the macro with the inputs and that should become a new macro which can be used by others.

 

The idea is if we create a sample macro like this it will not require us to create macros for every other department but just pass on this sample file and every department people based on their requirement will create from this file and start using the new created macro file.

 

I know this a strange request (at least for me) and if anyone has any ideas please suggest and also if this is possible or not.

 

it was a pain in the butt, but i wrote a demo menu for you. Going off this you can expand it as needed. Run the macro, and follow the prompts then run the macro again and voila... user defined macro menus!

 

so far only main menu options 1 and 2 allow for editing a sub menu.

 

from here using my example you can add variables that control the individual macros you need. sorry if i am rambling/cant type, its 4:22 am....

 

ping me if you have any questions/need help (I promise I will be more coherent later :P)

 

oh if you are running this on vista you need to run macroexpress program as an admin because it saves the macro menu info to C:\macro menu.txt. (obviosuly you can change that) right click on macroexpress icon and then click run as administrator.

 

you owe me a cookie :P

 

User_Defined_Multiple_Choice_Menu_Demo.mex

Link to comment
Share on other sites

 

I owe more than a cookie and i will never ever say to anyone that nothing cannot be done. Lesson learnt and i am ever grateful to you. should you have any help that i can do will do without hesitating. I am fan of your from today.

 

Thanks a lot lot....lot ....lot cant say how much..........

Link to comment
Share on other sites

After programing the menu how would one be able to add functions to it? I am a bit stuck while playing with this macro (very well done too) ty

 

 

That shouldn't be to hard, you would have to determine those in the macro itself. Probably the easiest way would have a predetermined list of menu options that the user could type into their templates to activate the macros. Then have the dialog boxes set to save item text to %T80% or something. then do an if %T80% = user report email, run user report macro, end if and then just do that for all the different options.

 

make sure to add this after the If statement for Delete Menu File and start over...

 

hrmmm you know, i could write this so instead of the user typing in the options and risking a typo, you could have it present a list of different options for them to select from for each menu option. if you need that, go ahead and let me know and i will see what i can do.

Link to comment
Share on other sites

  • 3 weeks later...
That shouldn't be to hard, you would have to determine those in the macro itself. Probably the easiest way would have a predetermined list of menu options that the user could type into their templates to activate the macros. Then have the dialog boxes set to save item text to %T80% or something. then do an if %T80% = user report email, run user report macro, end if and then just do that for all the different options.

 

make sure to add this after the If statement for Delete Menu File and start over...

 

hrmmm you know, i could write this so instead of the user typing in the options and risking a typo, you could have it present a list of different options for them to select from for each menu option. if you need that, go ahead and let me know and i will see what i can do.

 

Hello Brain Trust

 

If you could PM your information as well.

 

I am looking to get a couple macros created

if you are interested please let me know.

 

Christopher

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...