0

While developing code, I deleted the code I was working on.

ThisOutlookSession was somehow deleted and replaced with "Module2". Every time I boot up VBA now, I get a warning saying that the program does not trust Module2.

I can get ThisOutlookSession back as a separate Class Module, but not the same type as it was previously.

Is there a way to restore ThisOutlookSession to default status?

I am running Outlook 2010 w/VBA on an XP system.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
GregSpev
  • 75
  • 1
  • 4
  • 11

1 Answers1

2

Copy the code you have and save it somewhere.

Search for VbaProject.OTM in a Windows folder. Rename it something like VbaProjectOld.OTM. Do not delete until you see this works.

Restart Outlook. VbaProject.OTM should be regenerated and you should get a new ThisOutlookSession. Paste the code you salvaged in the appropriate modules.

niton
  • 8,771
  • 21
  • 32
  • 52