Jump to content
Macro Express Forums

Anyone use visual basic to create a multiple choice menu?


Recommended Posts

Hey all,

 

I'm trying to make multiple choice menus that have better formatting than MEP's default and was wondering if anyone knows if and how visual basic or autoIT can be used to create a better menu and then pass the selected variable back to MEP? I'm hopeful the "Use External Script" will work but I've been experimenting with it a little bit without much success. Also, does autoIT need to be installed on the user's machine for it to work?

 

Thanks in advance for your help.

Link to comment
Share on other sites

I'm trying to make multiple choice menus that have better formatting than MEP's default and was wondering if anyone knows if and how visual basic or autoIT can be used to create a better menu and then pass the selected variable back to MEP? I'm hopeful the "Use External Script" will work but I've been experimenting with it a little bit without much success. Also, does autoIT need to be installed on the user's machine for it to work?

AutoIt would certainly allow the generation of sophisticated multiple choice menus - you'll need to learn the language, with especial reference to the built-in GUI command set.

And no, the user does not need to install AutoIt since you can "compile" AutoIt scripts into .exe files.

Link to comment
Share on other sites

HTAs, VB, but probably not VBScript.....................

I'm learning VB and derivatives like VB Script, and VBA right now and am planning on doing what you are suggesting so this his highly theoretical advice.

 

I do not believe you will be able to build satisfactory dialogs with VBScript.

 

One can create a simple VB application to launch from MEP and depending on the type of results one can use windows controls and the relevant 'wait for' commands in MEP. IE when the user clicks "OK" have it display the results in a label and MEP can read that value back in with Get Control Text. VB.NET is pretty simple to learn and once you develop your basic menu form then in the future it would be super simple to make variants. I've messed with a few but have been holding off because it seems that if a learn a little more VB I can replace some of these macros with a complete VB apps.

 

BTW this is not a new issue. Some time ago Floyd came up with a method of doing the same using HTAs that was fairly brilliant. You might want to check that out as well.

 

I miss Floyd.

Link to comment
Share on other sites

'Scuz my ignorance but wot's HTA? Also, my suggestion for using VB: ....

 

I looked up answers.com: "HTML Application" was the only thing that seemed "sensible", but I'm none-the-wiser.

 

HTAs, VB, but probably not VBScript.....................

I'm learning VB and derivatives like VB Script, and VBA right now and am planning on doing what you are suggesting so this his highly theoretical advice.

...

One can create a simple VB application to launch from MEP and depending on the type of results one can use windows controls and the relevant 'wait for' commands in MEP. IE when the user clicks "OK" have it display the results in a label and MEP can read that value back in with Get Control Text. VB.NET is pretty simple to learn and once you develop your basic menu form then in the future it would be super simple to make variants. I've messed with a few but have been holding off because it seems that if a learn a little more VB I can replace some of these macros with a complete VB apps.

I'm no expert at VB. However (also, in theory), I would have thought the way to do it would be create a dialog in VB with a "UserForm", that you would eventually run (using MEP) as an ".exe".

Add radio buttons to the form for your multiple choices.

Presumably, you would save the state of your radio buttons (True/False) to a file when you close the dialog, and process the text file using MEP commands.

Link to comment
Share on other sites

Because I was once ignorant, too..............................

 

wot's HTA? Also, my suggestion for using VB: ....

After reading Floyd's trick the first time, and being completely confused about this whole HTA thing, I did some research, too. This is what I found:

http://www.microsoft.com/technet/scriptcen.../tutorial1.mspx

 

It seems VERY useful, since it's built into windows. However, like any programming language, you need to learn the required formatting, and VB Script is apparently needed. Since I don't know VB Script, I hit the learning curve at a dead run and broke my nose.

 

I still intend to learn, but between work and school and wife and daughter, I am just sitting at the bottom of the curve staring dreamily uphill.

Link to comment
Share on other sites

Thanks for all the great ideas and workarounds!

The HTAs hold tremendous promise and either "getting" the control or saving a file to then act upon, solve the issue of how to "pass" the variable back to MEP.

 

One last quick question:

- How do I convert that really cool executable "multiplefieldform.mxe" file created by Floyd into something editable? It doesn't import into ME Pro and changing it to an html is really messy. Is it because it was designed for an earlier version?

 

Thanks again!

Mike

Link to comment
Share on other sites

Thanks for all the great ideas and workarounds!

The HTAs hold tremendous promise and either "getting" the control or saving a file to then act upon, solve the issue of how to "pass" the variable back to MEP.

 

One last quick question:

- How do I convert that really cool executable "multiplefieldform.mxe" file created by Floyd into something editable? It doesn't import into ME Pro and changing it to an html is really messy. Is it because it was designed for an earlier version?

 

Thanks again!

Mike

 

The following steps work here:

 

1. Open multiplefieldform.mxe in my text editor.

 

2. Copy all text to clipboard.

 

3. Open ME Pro and start new macro.

 

4. Paste text into editor.

 

The macro then ran OK.

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

How do I convert that really cool executable "multiplefieldform.mxe" file created by Floyd into something editable? It doesn't import into ME Pro and changing it to an html is really messy. Is it because it was designed for an earlier version?

The .mxe extension indicates that this is a playable macro. You can import multiplefieldform.mxe into Macro Express or Macro Express Pro like you import any playable macro. Click File, Import, Import Playable Macros.

Link to comment
Share on other sites

Learning VB Script .......

Since I don't know VB Script, I hit the learning curve at a dead run and broke my nose.

I still intend to learn, but between work and school and wife and daughter, I am just sitting at the bottom of the curve staring dreamily uphill.

I know what u mean ...

However, I'm sure ur no dummy when it comes to these things, and it's just a matter of getting a toe into the door, proceeding a bit at a time. I don't know VBScript but the bits of it I've seen look an lot like Visual Basic about which I know a tiny bit.

May I suggest:

  • Recording macros with Visual Basic for Applications in the Microsoft Office applications - it's a good way to see how what you do translates into code. I'll bet u did it with ME.
  • Last time I looked (admittedly a long time ago), there a lot of web sites with tutorials and help on VB (haven't looked for VBScript).
  • I bought a book to learn some basics. Now, u can download pdf's (to try b4 u buy, of course - search google for pdf files: eg Visual Basic 10 for Dummies filetype:pdf.
  • Finally, if u can learn to how to use Visual Basics "Object Browser" to work out the relationships between objects, methods, properties etc and to find the appropriate Help on a command, I think that will save a bit of time eg so that u don't use a method or a property that doesn't belong to an object.

I should also mention that the Microsoft Community forums offer help for programming problems.

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...