Where does Outlook store the VBA code files?

前端 未结 4 663
囚心锁ツ
囚心锁ツ 2020-12-14 08:34

I had a VBA project in outlook with a few email macros - but after a PC crash they are all gone and all I see is a fresh \'Project1\' when I hit Alt+F11

I\'m not a V

4条回答
  •  暖寄归人
    2020-12-14 09:10

    Ok. things to try to fix this...

    I assume after the problem occured you tried logging back into the same windows user account, and the same Outlook profile.

    1. Create a new windows login to the machine in question.
    2. Login to this account and open Outlook, this will create a new outlook profile. make note of the profile name (to find this: Control Panel > Mail applet > Show Profiles...)
    3. Now Exit Outlook, and make sure it is not running (check for outlook.exe in task manager).
    4. Open Windows Explorer.
    5. Copy (don't cut) the existing VbaProject.OTM file. (if it has any other name than that, first rename it to VbaProject.OTM, then copy).
    6. Navigate to C:\Documents and Settings\USERNAME\Application Data\Microsoft\Outlook (or use the environment variable notation %appdata%\Microsoft\Outlook for vista/win7)
    7. Rename the existing VbaProject.OTM to VbaProject.OTM.OLD
    8. Paste the VbaProject.OTM from step 5 into this folder.
    9. Reopen Outlook and test (i.e. Alt + F11).
    10. Good luck with recovery.

    If this doesn't work do you remember adding self signing certificate at all? If so have you got a copy of the cert? you can try reinstalling it into the certificate manager (certmgr.msc) copy/install it to the Certficiates - Current User\Personal\Certificates hive.

    I just found this note from Sue Mosher (outlook VBA guru): "AFAIK, once an .otm file is corrupted, it can't be recovered. That's why I recommend that people who rely on VBA code export their modules or backup the entire file. "

提交回复
热议问题