views:

189

answers:

1

We have an old project that we maintain that uses brace indenting. Rather than having to change my Visual Studio options every time I switch projects, I'd like to be able to do this quickly and easily.

I'm trying to write a macro in Visual Studio to turn Brace Indenting on and off.

The checkbox is under Text Editor -> C/C++ -> Formatting

Indentation: Indent Braces

This doesn't work:

DTE.Properties("TextEditor", "C/C++").Item("IndentBraces").Value = True

I get "Value does not fall within the expected range."

Any ideas? I haven't been able to find anything on this.

+1  A: 

I found the following is the correct macro code to make this work

DTE.Properties("TextEditor", "C/C++ Specific").Item("IndentBraces").Value = True

see: "Determining Names of Property Items in Tools Options Pages" which is only mildly helpful in this situation but gave me enough of a clue to find it.

Ruddy
[facepalm] I could have sworn I tried that. Thanks!
Brown