Compartilhar via


Macro Files (Windows CE 5.0)

Send Feedback

Macros are stored in text files called macro files. A macro file (.dsm) can contain one or more macros.

After they are installed, the macro files load when you start the IDE. They are available to all workspaces but are independent of workspaces.

At the beginning of each macro file is a description of the file. You provide this description when you create the file. Following this description are the macro definitions.

Before you start writing or recording a macro, the IDE appends a macro stub to the file. This stub begins with a SUB statement containing the macro's name, continues with a description that you provide, and ends with an END SUB statement.

A macro's VBScript commands go between its SUB and END SUB statements. If you write the macro manually, you must insert these commands. However, if you record the macro, the IDE automatically inserts the commands where they belong.

The following code example shows a typical macro.

Sub MacroName()
'Description: The macro description goes here
'TODO: The VBScript commands go here
End Sub

You can automate your work in the IDE by recording VBScript macros that perform routine tasks.

You can quickly record and play back a macro, similar to the previous versions of the IDE, which provided keystroke-recording functionality. Alternatively, you can save your macro with a unique name so that you can edit the resulting VBScript macro file and rerun the macro whenever you want.

See Also

Macro Implementation | Macro Recording | Macro Operation

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.