Visual Studio 宏缩进 C/C++牙套
我们维护的一个旧项目使用大括号缩进。我希望能够快速、轻松地完成此操作,而不是每次切换项目时都必须更改 Visual Studio 选项。
我正在尝试在 Visual Studio 中编写一个宏来打开和关闭大括号缩进。
该复选框位于“文本编辑器”->“文本编辑器”下。 C/C++->格式
缩进:缩进大括号
这不起作用:
DTE.Properties("TextEditor", "C/C++").Item("IndentBraces").Value = True
我得到“值不在预期范围内”。
有什么想法吗?我没能找到任何关于此的信息。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现以下是正确的宏代码,使这项工作
可见:“确定工具选项页面中的属性项名称",这在这种情况下只有一点帮助,但给了我足够的线索来找到它。
I found the following is the correct macro code to make this work
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.