Just a quick tip to save some time debugging classes. Did you know that if you make changes to a class, the changes don’t take effect until you re-instantiate the class? That’s why you don’t see your changes taking effect, or your breakpoints being hit.
So, just re-run the AutoExec routine in the template you are editing (because that is usually where your class is initialised) and you should be in business.
If not, then possibly your class is not initialised in a separate routine, but is declared as a new instance of the class, like so:
Dim oMyClass As New MyClass
where MyClass is the name of your class. Just do a search through your code for the New keyword followed by the name of your class if you don’t know where it is.
If this is the case, then change the declaration to:
Dim oMyClass As MyClass
Then in your AutoExec (or other routine that is called before the class is required), add the following:
Set oMyClass = New MyClass
Now you can make changes to your class, rerun AutoExec (or the other macro that instantiates the class) and you can continue to debug. Saves restarting Word and having to setup all your breakpoints again.