问题
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