Is there VBA syntax highlighting for opening and closing loops and if statements?

一笑奈何 提交于 2019-12-08 00:44:02

问题


Sorry if this has been asked before but I can't seem to find any information on this. I am working with VBA for automating word documents and I have this huge block of code with tons of "if else" statements, "do while" loops and "with" statements all nested together.

When I program using other languages and other IDE's, I can normally click the opening "if" or "while" bracket and get the highlighted closing bracket. This makes it a lot easier to keep track of everything. Is there anything close to this functionality in VBA for Word? I am going mad trying to keep track of everything!


回答1:


I'm not sure it has what you are looking for, but Rubber duck for VBA has some pretty awesome features to upgrade the VBA IDE.


EDIT:

Two more things to try:

Smart Indenter - this one might actually help you more, as it creates intendation, thus helping to identify structures.

MZ-Tools - not free, but has a 30 day trial. (I haven't tried this one - report back if it is any good :) )




回答2:


Take a look at the Eclipse Colorer plugin which supports e.g. folding and if-then-else-end highlighting etc.:



来源:https://stackoverflow.com/questions/34232697/is-there-vba-syntax-highlighting-for-opening-and-closing-loops-and-if-statements

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!