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
1
vote
2 answers

"New Scope" Macro for Visual Studio

I'm trying to create a new macro that takes the currently selected text and puts curly braces around it (after making a newline), while, of course, indenting as needed. So, for example, if the user selects the code x = 0; and runs the macro in the…
user541686
  • 205,094
  • 128
  • 528
  • 886
1
vote
1 answer

How can I make the Recorder Toolbar stay visible?

I can make the Recorder Toolbar appear on my Visual Studio toolbar by right-clicking the toolbar, selecting 'Customize', then selecting 'Recorder', but the toolbar always get's removed when I stop recording. I believe this is a side-effect of the…
Greg Sansom
  • 20,442
  • 6
  • 58
  • 76
1
vote
0 answers

Rename Namespaces programmatically

I tried this code in visual studio 2010, to rename Namespaces, but his do nothing public void RenameNamespaces() { foreach (EnvDTE.Project aProject in DTE.Solution.Projects) { if (aProject.CodeModel != null) { foreach…
codeDom
  • 1,623
  • 18
  • 54
1
vote
0 answers

Access nested options dialog in EnvDTE

I'm trying to use EnvDTE to change a Visual Studio option. The EnvDTE object exposes the Properties collection to do this, and for example, to access the options exposed in the VS configuration dialog under Text Editor -> XML, one has to use…
1
vote
1 answer

How to select range of cells, from first non-black to last non-blank cell (VBA)?

I am attempting to export tables from excel workbooks to pipe-delimited txt files which are named in the same manner as the corresponding sheet. The issue is that I am not able to get my macros to iterate through the different sheets in a workbook…
MN Beitelmal
  • 165
  • 8
1
vote
1 answer

VS 2015 shortcut for "GoTo Region" #region / #endregion

Visual studio 2012 was having a working keyboard shortcut for moving to and fro between #region and #endregion. Ctrl + ] This was not documented anywhere and this was indeed a keyboard shortcut for moving to and fro between { and }. But the same…
1
vote
2 answers

Why is EnvDTE.ProjectItem.FileCodeModel = Nothing?

I wrote a VSMacro (in VS2010) that parses a solution and adds try and catch statements to cpp files. It's been working fine up until now. I had to reformat my pc and reinstall VS2010 and now it crashes. Here's a snippet from the macro. Sub Foo(ByVal…
Ernesto Rojo Jr
  • 163
  • 1
  • 1
  • 11
1
vote
2 answers

Visual Studio 2010 Macro to delete SQL files from a database project

I've discovered that in Visual Studio 2010 Professional it is possible to refresh the database for a SQL Server Database Project (This feature is normally only available to the Premium and Ultimate versions). All you need to do is delete all the…
1
vote
1 answer

Programming visual studio macros

I am frustrated trying to program macros for Visual Studio (using VS 2008, Version 9.0.30729.1 SP, with all updates). In the Macro Explorer, I can go to Microsoft's samples/VSEditor and add a Subroutine that behaves as I desire. But I can't seem to…
Mark T
  • 3,464
  • 5
  • 31
  • 45
1
vote
1 answer

Count non-whitespace characters for selection in Visual Studio 2010

does anyone know of a tool or extension to Visual Studio 2010 to count non-whitespace (e.g. all characters but not spaces, new lines etc.) for current selection in a document? Nice to have for code golfing :) I have a command line tool, but an…
nietras
  • 3,949
  • 1
  • 34
  • 38
1
vote
1 answer

incremental average using excel

I need to take the average of every 2 point increment, my data is in columns "a", as an example , and the average in column "b" a1 b1=0 a2 b2=a1 a3 b3=average(a1,a2) a4 b4=average(a2,a3) a5 b5=average(a3,a4) ... I need an excel formula or macro to…
predictive
  • 33
  • 1
  • 7
1
vote
2 answers

Discatenate in microsoft excel

I have a list of IP addresses, lets say as follow: 192.168.1.1 192.1688.2.1 192.168.3.1 Now I would like to write a macro in excel where when I enter an IP address in a column, for instance 192.168.3.48, it should search the first three segment…
spaniard89
  • 307
  • 1
  • 6
  • 18
1
vote
1 answer

Should I include VB macros in source control with my project?

For a C# project, I make use of several Visual Basic macros in Visual Studio. I was just considering that these would be of use to other developers that work on the C# project. The macros so far include removing trailing whitespace on save,…
Sarah Vessels
  • 30,930
  • 33
  • 155
  • 222
1
vote
0 answers

macro definition that would differentiate static and non static function

Suppose I have two functions, one static and one non static as follows, #define PRINT_INFO(__FUNCTION__,...) cout<<__FUNCTION__<<__VA_ARGS__ void static fun1(); void…
user2626431
  • 447
  • 1
  • 10
  • 20
1
vote
1 answer

Visual Studio Automation: Programatically get a project output directory

I want to programatically get a project output directory in a Visual Studio macro. I managed to get a string of the path (through prj.ConfigurationManager.ActiveConfiguration.Properties and looking at property OutputDirectory) but this string may…
Zack
  • 2,021
  • 4
  • 18
  • 19