Questions tagged [visual-studio-macros]

A macro is a series of commands and instructions that you group together as a single command to accomplish a task automatically. Macros allow you to automate repetitive actions. Visual Studio includes the Macros integrated development environment (IDE), which is used solely for creating, manipulating, editing, and running macros. The Macros IDE is separate from the Visual Studio IDE.

The Visual Studio Macros integrated development environment (IDE) has the same look and feel as the Visual Studio IDE, but is separate from it. The Macros IDE includes the Code Editor and several tool windows. These windows function the same as their Visual Studio counterparts, except that they apply specifically to the code and projects within the Macros environment.

209 questions
2
votes
0 answers

How can I call a macro with multiple arguments via the Visual Studio IDE?

In Visual Studio 2010, if a macro has one argument, you can call it from the Command window, the Find box, or the Immediate window, by typing >Foo bar where Foo is the macro name and bar is a string argument. But if the macro has two or more…
Igby Largeman
  • 16,495
  • 3
  • 60
  • 86
2
votes
1 answer

Recover Visual Studio 2010 macros from a previous install?

I'll keep it short and simple. I had a OCZ Vertex 100Gb SSD that I had my operating system and programming tools aka VS2010. Anyway the drive failed and Windows went kaput, however I am able to recover certain folders including all those related to…
Stewart Stoakes
  • 797
  • 1
  • 8
  • 13
2
votes
3 answers

Writing to current document with a visual studio macro is extremely slow, suggestions to speedup?

Generally I've no complaints about the speed of Visual Studio, but if I write a macro that writes out about 100 lines of code, it takes 1-2 minutes to complete. That doesn't sound right. Is there another more convenient way to write code blocks?…
Abel
  • 56,041
  • 24
  • 146
  • 247
2
votes
1 answer

Interacting with dialogs in VS2010 with the Macro Recorder (using Visual Studio Macro Recorder to enter keystrokes automatically)

In one of my other questions, I inquired about a shortcut to enable a particular feature in the VS2010 IDE. It looks like the only way to make it happen is through the Macro Recorder, which I have unfortunately never used (as it looks quite…
Dave
  • 14,618
  • 13
  • 91
  • 145
2
votes
3 answers

Is there a Cut & Paste as New Class File (Macro)?

I'm looking for a free Visual Studio feature, extension or macro. that can help with the following situation. When I prototype I tend to keep all my classes in one file (bad practice I know, but yeah it a prototype). Then comes the point the where…
Adam Speight
  • 712
  • 1
  • 9
  • 21
2
votes
1 answer

Visual Studio Macro: How to format xml files?

I derived a small macro script from Visual Studio Macro to Format all Files in a Solution but unfortunately it doesn't work with xml, xaml, config etc. All ProjectItem that are xml-based normally throw an exception (command not available) when they…
2
votes
1 answer

How to Program a Visual Studio 2010 Macro For accessing and editing specific Project files?

i want to write a macro to put selected text to a specific XML file in my project. for example my path is ~/Pages/Dictionary/en.xml. and i want to put selected text from an aspx.cs file to en.xml file. please guide me from where I should start. i…
Mehdi
  • 5,435
  • 6
  • 37
  • 57
2
votes
3 answers

Visual Studio Macro to list Projects instead of solution folders

Using the following code gives me Solution folders instead of real projects. projectName = DTE.Solution.SolutionBuild.StartupProjects(0) For Each project In DTE.Solution.Projects If project.UniqueName = projectName Then Return project …
Mrchief
  • 75,126
  • 20
  • 142
  • 189
2
votes
0 answers

Macros and outputs using build agents for visual studio 2010

I'm trying to get team build and build agents working for our app for the first time. I've run into a few issues with the way we do our project settings which don't work well for build agents that I'm trying to clean up. However I'd like to ask…
John C
  • 611
  • 1
  • 9
  • 26
2
votes
1 answer

How can I turn DTE.ActiveWindow.Selection into the closest CodeElement in a VS2008 Macro?

I'm working with the Visual Studio 2008 object model as seen here: VS2008 Automation Object Model Chart. I want to act on a CodeElement in a VS2008 Marco, one that is chosen by the user's text selection in the current .cs document. While I don't…
ZeroBugBounce
  • 3,652
  • 3
  • 31
  • 40
2
votes
1 answer

How to give a time delay in Visual Studio macros

Recently I updated my Visual Studio and start using the extention Macro Explorer. I tried to use one of the sample macros "removes and sorts all", but I realized if I have a open documents, it doesn't run. So I closed all my open documents and try…
Mohammad
  • 2,724
  • 6
  • 29
  • 55
2
votes
1 answer

How to change from keyboard events to mouse events

The code below been programmed to do keyboard event's listening, but I want to change it to listen to mouse buttons. For example, Instead of feeding fast with Q I want it to be with right mouse button, instead of split with space I want it to be…
2
votes
1 answer

Can I have a macro run whenever I save a file in Visual Studio 2005?

When I save a file in Visual Studio 2005, I'd like to have a macro also run that updates a copyright (through a regular expression search and replace). I'm not new to regular expressions, but I am new to VB/VBA and Visual Studio macros, so what I…
Mark
  • 1,124
  • 1
  • 14
  • 21
2
votes
4 answers

How do I alter code at compile time based on a flag in C#

I want to set up a debug flag such that would replace "Console".Writeline with "Log".WriteLine. I don't want to write if (debug) Log.writeline("log"); else Console.Writeline("log"); every time I want to log info. Something like…
2
votes
2 answers

Excel VBA range.find acting up

Im trying to use range.find to look up a value within a column, and return the matching value from the next column. I recorded the find() using the macro recorder, which seemed to work fine for a while, but for some reason it's now giving me an…
Tyler Durden
  • 317
  • 3
  • 4
  • 11