Results 1 to 6 of 6
  1. #1
    2 Star Lounger
    Join Date
    Oct 2002
    Location
    Lakewood, New Jersey, USA
    Posts
    187
    Thanks
    0
    Thanked 0 Times in 0 Posts

    error opening VBA Editor (Outlook 2002 SP3)

    I wrote a macro in ThisOutlookSession and created 2 rules which ran this macro when email from a certain sender was received. The other day, I opened my Outlook and got errors when email from this sender came in saying that the function could not be found. Today, I tried opening Visual Basic Editor from Outlook (Tools - Macros - VB Editor) and I get the error File Not Found. If I click OK and try to open the Editor again, it opens but there's no ThisOUtlookSession in the project explorer (in fact, there's nothing in the PRoject Explorer). I've tried removing the rules, reinstalling Office... all to no avail. IF anyone has any suggestions as to how to get my ThisOUtlookSession back, I'd appreciate it.

  2. #2
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: error opening VBA Editor (Outlook 2002 SP3)

    It sounds like your OTM file, which holds Outlook VB code, is corrupted. Can you find any '*.OTM' file on the PC? (You may have to search hidden files and folders.) Make a copy of it with a different extension name, and then delete the OTM file and see what happens when you reopen Outlook.

    Outlook VB can be a bit temperamental, every time you develop significant Outlook code, export it to a *.BAS file as backup.
    -John ... I float in liquid gardens
    UTC -7ąDS

  3. #3
    2 Star Lounger
    Join Date
    Oct 2002
    Location
    Lakewood, New Jersey, USA
    Posts
    187
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: error opening VBA Editor (Outlook 2002 SP3)

    Thank you John. I believe that you're right because uninstalling and reinstalling Office did not work! However, when I deleted the OTM, I got my "ThisOutlookSession" back. Next time, i'm exporting! One more question please as I'm not experienced in Outlook VBA development. If i want to write a script that will run every time a certain type of email is received, I write it in ThisOutlookSession - correct?

  4. #4
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: error opening VBA Editor (Outlook 2002 SP3)

    If you are using an Event, you have to hook it in the ThisOutlookSession module; I prefer to have as little code as possible in the Event procedure, and so with any code longer than a few lines I have the Event Procedure call a public procedure in a regular Module. Other wise ThisOutlookSession gets crammed with stuff that can be hard to follow. (Although I dabble in Outlook coding, I actually use very little Event driven code.)

    By the way, you may be able to recapture some of the code in the damaged OTM (which you backed up, correct? <img src=/S/grin.gif border=0 alt=grin width=15 height=15>) by reviewing it in WordPad or a Hex Editor, and using Copy-&-Paste.
    -John ... I float in liquid gardens
    UTC -7ąDS

  5. #5
    2 Star Lounger
    Join Date
    Oct 2002
    Location
    Lakewood, New Jersey, USA
    Posts
    187
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: error opening VBA Editor (Outlook 2002 SP3)

    I actually prefer to use a rule that runs a script upon receiving mail from a particular source. I didn't save my code as it was all test stuff (and not too much of it at that!). Thanks for your help.

  6. #6
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: error opening VBA Editor (Outlook 2002 SP3)

    Sorry, I didn't answer your question. if you use a Rule to call a script you may, but do not need to, have the code in the ThisOutlookSession Module, it can be in a regular Module. <!profile=JScher2000>JScher2000<!/profile> has some information on using Rules to call code, start at his <post#=385428>post 385428</post#>.
    -John ... I float in liquid gardens
    UTC -7ąDS

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •