I assume you are referring to
keyboard macros: the kind that you get from the Tools / Macros menu (as distinct from macro substitution). If so, this is a design-time facility; it is not available from within a VFP EXE.
However, you can create your own macro facility fairly easily. One way to do that is with the ON KEY LABEL command. You can assign any series of keystroke to a variable, and then when the user hits the specified key, use the KEYBOARD command to simulate that string being typed.
You will also need a way of letting the user specify the characters that they want to assign to the key in question. To do that, you will need a simple form in which the user can type the relevant string, and also specify the relevant key.,
If would be a little more difficult if you want allow the character string to also contain control characters, such as ALT and CTRL combinations, or cursor movement keys. In that case, you will probably need to use the Keypress event to trap the required keys in the form mentioned above, but the basic principle will be the same.
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
Visual FoxPro articles, tips and downloads