Visual Studio Macros

DTE – meaning got lost in time.¬†Application object –¬†Development Tools Environment.

Use record macro, inspect and learn

ProjectName = DTE.ActiveDocument.ProjectItem.ContainingProject.Name
DTE.ActiveDocument.Selection.Text = “Hello World”


Visual Studio Macros “Cannot load the recording macro…”

“Cannot load the recording macro project ” for the following reason:
‘C:\Users\<username>\Documents\Visual Studio 2010\Projects\VSMacros80\MyMacros\MyMacros.vsmacros’ is an invalid or inaccessible macro project file
Would you like to recreate it?”
Yes or No

Solved Answer No.
The problem may well be that you are not using C, maybe using D or another drive.

If looking in the wrong place then set the macro recording project to the other project then unload the current project. If necessary move any new created macro project to where you want it then open it. Repeat for samples.