I've just tested that in VBA, but didn't know how to write the surrounding code. The single line didn't work, it gave me a compile error.
I've found something interesting though: I tested the line in a iLogic rule when I opened the concerning assembly without changing anything, and then it worked. Then I tried the same rule after running a configurator plugin (which we use for this assembly). This configurator changes a few parameters of my assembly to default values if I run it. I ran the configurator, then the same iLogic rule didn't work anymore (it gave the aforementioned error).
Is there something known which would prevent running the 'rebuild' method?
Edit: found that it has something to do with the complete iLogic rule that I've posted earlier. After running that iLogic rule the rebuild method gives an error. The complete iLogic rule is also triggered by the configurator plugin we use so that's why the rebuild method wouldn't run after running the configurator either.
Edit 2: Found the problem:
SyntaxEditor Code Snippet
ThisApplication.ActiveDocument.Save
ThisApplication.ActiveDocument.Rebuild()
This combination doesn't work. Save2 method neither. Don't ask me why, but removing the line which saves the document, solves the problem. In this case that line isn't necessary so as far as I am concerned it is solved. But this behaviour seem to me as unintended? Maybe a little bug?