Writing a Macro Manually (Windows CE 5.0)
You can manually create a macro if you do not want to edit an existing one. With the macro editor, you can edit a macro or add to a macro you have recorded.
To write a macro
From the Tools menu, choose Macro.
Choose Options; choose New File to add the macro to a new macro file, type a name and a description for the file, and then choose OK.
- or -
In the MacroFile box, select the file name to add the macro to a file.
If the file name is not in the list, install the file and then select it in the MacroFile box.
In the Macro Name box, type a name for the macro.
Choose Edit.
You cannot create a macro in a read-only file, but you can browse an existing macro in a read-only file.
In the AddMacro dialog box, type a description of the macro; then choose OK.
The macro file opens and a SUB block is created for the macro at the end of the file.
The following code example shows the SUB block for a macro named MyMacro.
Sub MyMacro() 'Description: The macro description goes here. 'TODO: Insert the macro code here. End Sub
(Conditional) If you use variables in the macro, declare the variables by using the VBScript DIM statement.
You can be reminded to declare variables before using them by adding OPTION EXPLICIT at the beginning of each macro file.
See Also
Send Feedback on this topic to the authors