Jump to content
Macro Express Forums

Multiple Choice Pick List


fredharris

Recommended Posts

In ME I am trying to create a Multiple Choice list of about 30 text phrases that I want to insert into my word processor but in the order I pick them from the Multiple Choice Window. Currently it will only place them in the order in which they are listed in the multiple choice window. For example.

10 choices 1 to 10. If I select choice 7,2,9,3 - they are inputted as 2,3,7,9 when I would like to have them inputted as 7,2,9,3. I want to be able to select them from the multiple choice box at one time and have them inserted in the same order I chose them. Any suggestions?

Link to comment
Share on other sites

I thought this would be easy, but apparently not.

 

I came up with a rather crude way to implement this. It just uses a loop which presents a list of choices for the required number of selections (5, in this example). Each time you make a selection, it is appended to a text variable, T2.

 

The text box called "Variable update" is just for your information and it provides a real-time update of what you have selected. It is not actually needed for the macro to run.

 

On the plus side, this method allows you to select the same item multiple times, and it can also accept an arbritary number of selections, even if they are less than the maximum set. In this example, you could just select 3 names and click Cancel, and the macro will present what you have selected so far.

 

In either case, the final selections will be in the T2 variable, separated by commas. If you need to further assign the selections to separate variables, you can first save T2 to a text file, then use the Process an ASCII Delimited Text File commands to complete the task.

 

Repeat Start (Repeat 5 times)
 Text Box Display:  Variable update
 Multiple Choice Menu: Test multi-pick
 If Variable %T1% = "CANCEL"
   Break
 End If
 Variable Modify String: Append %T1% to %T2%
 Variable Modify String: Append "," to %T2%
 Text Box Close: Variable update
Repeat End
Text Box Display:  Selection complete

 

For the complete code, download and import the file below.

multi_pick_remember_order.mex

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...
×
×
  • Create New...