Last week I had a failure trying to use my automated email file fetcher (see Retrieving Files Via Email). I was working from home, and I needed to get my notes from work to my home machine so I could parse them into a status report. But Outlook kept throwing an error.
I’m including this in the Tips section because my Google searches on the error turned up nothing. I know this information is one of those things that isn’t going to be useful to everyday life, but hopefully it will save someone, somewhere, some time.
I went to run my Outlook file fetcher, and the macro didn’t run at all. So I went into the Macro window (Alt+F8 in Outlook 2007) and got an error: File Not Found.
In addition, the macro list was empty, and when I tried to create a macro by typing in a name and clicking on New nothing happened.
Next I went to the Visual Basic Editor (Alt+F11 in Outlook 2007) and there was nothing there – no project files, or macros. I could not create one through the menus.
Apparently the problem lies in a corrupted VbaProject file. The way to fix this:
- Quit Outlook.
- Locate the VBA file. In standard Outlook installations it will be in the C:\Documents and Settings\[user name]\Application Data\Microsoft\Outlook directory.
- Locate and rename the old VbaProject file. It will be VbaProject.OTM. I renamed mine VbaProject.Old.
- Create a new VbaProject file through Outlook. Restart Outlook and open the Macro window. Type a name in and press create. This should open up the Visual Basic editor window with a correct project file.
- Quit Outlook, saving changes. Make sure to save the changes to the VbaProject file.
- Put back your macros. At this point you can put your macros back. You might be able to open the corrupted file in a text editor to extract the code; mine was too far gone for this.
Photo by stallio