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 really care how I get it, this is what I tried: The VS object model gives you DTE.ActiveWin...
I got a C# application with Visual Studio 2005.
The code has some 300KLOC code, which has been raped over 3 years.
When I was going through code found out that lot of unused functions/methods/properties. Its not possible to clean the code manually (Requires checking each member and if found no references delete it.)
I am looking to au...
I have been trying to write a short macro in Visual Studio that activates the FindSymbolResults (Constants.vsWindowKindFindSymbolResults), and then moves to the next item in the list (if anyway) and calls Edit.GotoReference on it. The first and last parts - show the window and call Edit.GoToReference - are done, but I am struggling with...
I'm normally developing web apps, and a surprisingly large amount of my work time is spent doing "Ctrl + Alt + P", sorting by Process Name, and picking w3wp.exe to attach my debugger.
To make matters worse, I'm working on an app that spans several application pools, so I normally have 2 or 3 instances of w3wp.exe, and it's impossible to...
Is there a keyboard shortcut or macro to collapse all regions in Visual Studio's toolbox? (Failing either of those, I'll take an addin that allows this!)
...
Note: The accepted solution doesn't quite work, but it's very close.
Is there a macro or keyboard shortcut that will toggle "break when an exception is thrown" without using the GUI.
Opening the dialog with ctrl+alt+e and checking the "Common Language Runtime Exceptions" "Thrown" box then clicking OK is simple enough, but this is som...
I'm trying to run the Visual Studio 2005 sample macro that attaches the debugger to calc.exe. Neither it nor any other macro seem to do anything when I run them. Calc.exe is running. "Tools->Options->Add-in/Macros Security->Allow macros to run" is checked. The error list shows no errors.
...
If I add a WindowEvents_WindowActivated handler to my Visual Studio 2005 Macros EnvironmentEvents module, I get a weird side-effect: when I click from one window to another in Visual Studio, that click is treated as a double click.
So for instance, I put the focus in an editor window and click a file in Solution Explorer, and the file o...
I've been explained there is a Macro which iterates through all the menus. Having checked CodeProject, and various places on the web I'm out of luck so far.
Does anyone know any better?
Thanks
Beth
...
I want to make a macro for PowerPoint, to generate a custom show, containing all the slides from my PowerPoint but in random order.
How would I do this?
I want to be able to run it and create different custom shows each time.
It's been 3 years since I used PowerPoint, and the only experience I have with VB was a little bit of VB6 in 200...
I have a huge solution file with lots of projects in it. I suspect that some of the projects that are referenced to by other projects are missing from solution. Is there an easy way to detect missing references in Visual Studio? (I am using 2008)
...
I'd like to write a macro to crawl through the files in my project directory and find files that aren't included in the project.
In playing around with the DTE object, I see that the Project object has ProjectItems; if a ProjectItem represents a directory, then it has its own ProjectItems collection. This gives me all files that are in...
Is it possible using macros in Visual studio 2008 to change command line arguments for debug project?
In project->properties->debug i can set manually comm line args for debugging.
I'd like to change them with macros, not with hands.
...
I have the following Visual Studio Macro:
Imports System
Imports EnvDTE
Imports EnvDTE80
Imports EnvDTE90
Imports MyMacros.EnvironmentEvents
Imports System.Diagnostics
Public Module Module1
Private WithEvents buildEvents As EnvDTE.BuildEvents = EnvironmentEvents.BuildEvents
Public Sub BuildEvents_OnBuildBegin() Handles buildE...
I'm trying some VS2005 IDE macros to modify a large amount of projects (~80) within a solution. Some of the properties I wish to set do expose a programmatic interface to 'default', but many others do not. Is there a generic way to set such properties to their default? (eventually meaning erasing them from the .vcproj file)
Simplified ...
Found this:
Sub SurroundWithAppendTag()
DTE.ActiveDocument.Selection.Text = ".Append(""" + DTE.ActiveDocument.Selection.Text + """)"
End Sub
But I can't seem to figure out how to loop through each line of text in the selection. Any thoughts?
...
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 need help with specifically is:
getting a macro to run upon save, preferably after I pres...
I'd like to have a macro in Visual Studio 2005 that calls a DOS command and redirects the output (stdout and stderr) to a file. Just calling the command and ">" redirecting it will not capture stderr, so there are two parts to this:
calling a DOS command
capturing both stderr and stdout to a file during that call
I'd then like to o...
no way? standard .net dll only?
...
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, organizing using directives and removing unnecessary ones, and an override for Ctrl-M Ctrl-O tha...