Is there a way to recover the vba code from a corrupt
vbaproject.otm file? Possibly view it as just a text
file to copy/paste into a new .otm file?

Sue Mosher [MVP]

I don't think so. I've lost a few (which is why I always either create a real COM addin or export the individual modules) and haven't had any luck recovering them. But you can try opening in WordPad.
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
Apr 22, 2023
Reaction score
I know, this is very old thread, but probably others suffer still from this problem, like I did.

I had this problem, corrupted VbaProject.OTM file, causing Outlook to crash on start, and of course working backup was from weekly backup last week. Whole week of coding, with lot of changes.

I even deleted and reinstalled Outlook, because did not understand what the crashing problem was. Nor did the Microsoft checkprograms or any other solutions here help:

Then desided to try renaming the VbaProject.OTM file, because I had just last night done coding. And in morning the problems started. So the file was somehow corrupted.

I was able to recover by copying the broken VbaProject.OTM from PC1 to PC2 with same setup (Outlook 365, Windows 10). Outlook on PC2 did open it just fine. Then exported all forms and modules, copied these to PC1.

On PC1 deleted the corrupted VbaProject.OTM from %appdata%\Microsoft\Outlook, copied the week old backup to there. Then Outlook started again fine. Then imported changed files that were recovered with PC2.

Lessons learned:
Allways also export all objects, modules and forms after big changes.
Do not rely just on the VbaProject.OTM copy, you may have a broken copy in your hands.

Also, there is a bug on the VbaProject.OTM file modified timestamp, it does not update. So I recommend naming your copies with date, like VbaProject_2023_04_22.OTM, just to make it easier to know how what copy is in hands.

Reports of this date bug has been around at least from 2007, still no MS fix for this, for example:

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question