2

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!

Ben Rhys-Lewis
  • 3,118
  • 8
  • 34
  • 45
Kurt Leadley
  • 513
  • 3
  • 20

2 Answers2

2

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 :) )

vacip
  • 5,246
  • 2
  • 26
  • 54
  • Thanks, I'll have to check it out when I leave work. I can't download software here, – Kurt Leadley Dec 11 '15 at 21:24
  • Yeah well, I have it installed, and checked it, and can't seem to do what you are looking for. :( Sorry. Anyway, it is a very useful tool, making VBE a lot more powerful. – vacip Dec 11 '15 at 21:26
  • Bummer! Thanks for checking for me. I might try out Rubber Duck anyways. – Kurt Leadley Dec 11 '15 at 21:29
  • 2
    @KurtLeadley I have added two more references to my answer. Smart Indenter might help you with your problem. It is still not exactly what you are looking for, but makes the code a lot more readable, and makes it a lot easier to find the end of an `If...End If` statement. – vacip Dec 11 '15 at 22:06
1

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

enter image description here

Andreas Covidiot
  • 4,286
  • 5
  • 51
  • 96
  • Correct me if I'm wrong, but this doesn't work inside the VBE IDE but in Eclipse, right? Unfortunately MS Office VBA is really only useful inside the VBE IDE... – vacip Dec 27 '18 at 08:30
  • Only Eclipse - right. For standard programming I would also not use the Eclipse IDE - right. But for version control, minor bugfixes, search/find/replace, renaming, documentation, analysis of existing code/libraries, source linking in issue tracking etc. it can be quite handy! – Andreas Covidiot Dec 28 '18 at 21:18