User Submitted Macro

HTML Helpers

Written by Brad Heintz, http://www.bradheintz.com

What they do

The Bold, Italic, and Underline macros take the selected text and wrap it in bold, italic, or underline HTML tags.

The Bold Last Word, Italic Last Word, and Underline Last Word macros select the previous word in your text editor (using CTRL-SHIFT-LARROW) and wrap it in the appropriate tags.

The Link macro takes the highlighted text (which should be a URL) and puts it in the href attribute of an anchor tag, closes the tag, and places the text insertion point inside the tag so you can add the link text.

All of these macros are activated by Hotkeys. Clipboard state is preserved by all these macros. They can easily be adapted to other tags or text markup languages.

To install

Download the macro file umhtmlhelpers.mex and save it to your hard drive where you store your macro file(s).  Import the macros into your existing macro file by clicking File, Import, Import Macros.

To use

Select (highlight) your target text (if necessary) and hit the correct hotkey:
– Ctrl-Alt-Shift-[B,I,U] for [Bold, Italic, Underline]
– Ctrl-Alt-[B, I, U] for [Bold, Italic, Underline] Last Word
– Ctrl-Alt-Shift-A for Link

Requirements

These macros are intended to be used in a normal Windows text editor such as Notepad, ConTEXT, SciTE, Visual Studio.NET editor, a text box on a web form, etc. Use in any other environment may produce random results.

** Brad wins a Macro Express T-shirt for his submission.