0

Good day, I have a VBA script running as a rule for a few months now, which basically saves some attachments from a specific sender into some folders. Recently, the module had to be edited to add a few lines for a new Folder. The new script worked as expected the day it was implemented. The problem is, the next day, after shutdown, all the changes made were reverted to the previous version. So, it seems I am stuck with that first script made.

How can I edit the script and actually have the changes saved?

PS. We are using MS Server 2012 and Outlook 2013

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
ConAchilleos
  • 103
  • 1
  • 3
  • Just to rule out the obvious, did you save the VBA project before restarting Outlook? – silentsurfer Feb 05 '15 at 12:09
  • Do you use a roaming profile? – Eugene Astafiev Feb 05 '15 at 12:14
  • yes, roaming profiles are used – ConAchilleos Feb 05 '15 at 12:32
  • That's the cause of the issue. See [Where does Outlook store the VBA code files?](http://stackoverflow.com/questions/233702/where-does-outlook-store-the-vba-code-files) for more information. – Eugene Astafiev Feb 05 '15 at 12:35
  • thank you! I will try to export the macro then and copy/paste it in the folder... hopefully it'll do the trick – ConAchilleos Feb 05 '15 at 12:41
  • I just (June 2023) had this same problem. I didn't save my VBA changes yesterday and they are gone today. Are they now lost forever? On most programs you are prompted to save your work if you close down without saving. I find it amazing the Microsoft would simply throw away my changes because I didn't hit 'save'. – Blitzer Jun 03 '23 at 09:31

2 Answers2

2

We saw this happen with roaming profiles.

We noticed that the modify date of the OTM file is not changing in C:\Users\"usename"\AppData\Roaming\Microsoft\Outlook

Therefore, when user logs off and profile synchronizes back to the profile host server, this file does not appear to have changed, and does not get synchronized. When user logs in next day and downloads fresh copy of profile, they keep getting old OTM file...

Our solution was to write code to manually change the modify date of the OTM file in the VB script.

William
  • 21
  • 2
1

I bielive the issue comes from the roaming profile. See Where does Outlook store the VBA code files? for more information.

There is a chance you closed Outlook without saving the VbaProject.OTM. You may find the following commands on the main menu or on the command bar:

enter image description here

You may find the Getting Started with VBA in Outlook 2010 article helpful.

Community
  • 1
  • 1
Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45
  • I did save the project... Tried it on different Computers also. The first time I add a module it's saved normally. If I shutdown, edit the code, save and shutdown again, the edited code will not appear, but instead only the first one – ConAchilleos Feb 05 '15 at 12:15
  • I bielive the issue comes from the roaming profile. See [Where does Outlook store the VBA code files?](http://stackoverflow.com/questions/233702/where-does-outlook-store-the-vba-code-files) for more information. – Eugene Astafiev Feb 05 '15 at 12:38
  • 1
    You might want to edit your answer and I will gladly accept it! Don't want to misinform any people who stumble upon this in the future ;) – ConAchilleos Feb 05 '15 at 12:52
  • I just (June 2023) had this same problem. I didn't save my VBA changes yesterday and they are gone today. Are they now lost forever? On most programs you are prompted to save your work if you close down without saving. I find it amazing the Microsoft would simply throw away my changes because I didn't hit 'save'. – Blitzer Jun 03 '23 at 09:31