Keyword Expansion

Top  Previous  Next

 VS   VB6   VB5   VBA 

The Code Library Personal Options, Code Library Team Options and the Exception / Error Handlers Options allow you to associate an "expansion keyword" for each code template. The keyword expansion feature works as follows:

  • Define the keyboard shortcut that you will use to expand the keyword:
    • For Visual Studio: Go the Options window of Visual Studio, section Environment | Keyboard, and locate the MZTools.ExpandKeyword command for Visual Studio 2015 and higher and the MZTools8.ExpandKeyword command for Visual Studio 2013 and lower. Then, associate a shortcut key to that command.
    • For VB6 / VB5 / VBA: Go to the Keyboard Shortcuts Options and associate a keyboard shortcut (for example, Ctrl+Shift+E) to the Expand Keyword feature:

ExpandKeywordKeyboardShortcut

  • Associate an expansion keyword to a code template or exception / error handler (for example "scm" in this image):

CodeTemplate

  • In your code window, type the expansion keyword that you have defined for the code template (for example, "scm" in the previous image):

BeforeKeywordExpansion

  • While the cursor is at the end of the typed keyword, press the keyboard shortcut defined in the first step (Ctrl+Shift+E in the example). The typed keyword in code is replaced (expanded) by the whole code template:

AfterKeywordExpansion