Hardware Reference
In-Depth Information
click on the name of the menu (again, on that small toolbar) where you put
the command, and then right-click (or Control-click) the command name and
choose Properties from the contextual menu. Type a new name and click OK.
5. Click OK to close the Customize Toolbars and Menus window.
Your new macro command should be on the menu (the real menu) where you placed it.
You can even add your own menu (and name it Macros , for instance), by following the above
procedure but selecting New Menu at the bottom of the Categories list and then dragging the
New Menu command to the desired spot in the toolbar.
Run an Existing VBA Macro
We've already been using VBA, but now I want to switch gears slightly to show you how to
use a macro someone else wrote—for example, something you find on a Web page.
For this example, I'll use a macro I wrote years ago to paste whatever's on the clipboard as
plaintext,sothatitassumesthestyleofthesurroundingtext.Ifyouweretodothismanually,
the process would be: Choose Edit > Paste Special, select Unformatted Text, and click OK. A
macro can reduce all that to one click or keystroke!
To use a macro someone else has written:
1. Choose Tools > Macro > Macros.
2. Type a new macro name (we'll use PastePlainText ) and click Create.
3. Inthewindowthatopens,you'llseeaplaceholdertemplateforyournewmacro,
like so:
Sub PastePlainText()
'
' PTT Macro
'
'
End Sub
4. Paste or type the following in the blank space before the End Sub line:
Selection.PasteSpecial Link:=False, _
DataType:=wdPasteText, Placement:=wdInLine, _
DisplayAsIcon:=False
Search WWH ::




Custom Search