Skip to Main Content
Visual Studio Hacks
book

Visual Studio Hacks

by James Avery
March 2005
Intermediate to advanced content levelIntermediate to advanced
304 pages
19h 23m
English
O'Reilly Media, Inc.
Content preview from Visual Studio Hacks
202
|
Chapter 6, Speed Hacks
#51 Create a Macro
HACK
If you select Macro Explorer from the Tools Macros menu and open the
Recording Module, you will see a new macro called TemporaryMacro. This
is where the code for your actions during recording is created. Because the
Macro Recorder will always create the same macro routine, you must now
either copy the code to another macro module or at least rename the macro
created by the recording process, or your macro will be lost the next time
you record a macro. To change the name of the macro, right-click on the
macro in the Macro Explorer and select Rename.
Macro recording is a powerful way to quickly create fairly simple macros,
but it also has some major limitations. First, any selections in the Solution
Explorer or Class View will be specific to the file or class selected, so it will
be linked to the filename or class name. This can be overcome by editing the
recorded macro and using variables in place of the filenames.
Second, some actions, such as attaching to a process to debug, will not be
recorded. Most of these actions can be coded into macros, but you will have
to code these by hand.
Creating Macros from Scratch
If the limitations of the macro recorder make it impractical for your situa-
tion or if you are creating a complex macro, then you can create a macro
from scratch. To create macros from scratch or to edit existing macros, you
will use the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Microsoft Visual Studio 2015 Unleashed, Third Edition

Microsoft Visual Studio 2015 Unleashed, Third Edition

Mike Snell, Lars Powers
.Net Framework Essentials

.Net Framework Essentials

Thuan L. Thai, Hoang Lam
C# 5.0 Unleashed

C# 5.0 Unleashed

Bart De Smet
Programming .NET Security

Programming .NET Security

Adam Freeman, Allen Jones

Publisher Resources

ISBN: 0596008473Errata Page