Share via

"File not Found" error opening macro template

Anonymous
2011-04-01T15:20:02+00:00

I occassionally receive an error after working in a Word 2007 macro template.  The error is simply "File not Found" but the problem is that the entire code module has been removed from the template and i do not know how to get it back. 

I have have a macro template that i have several code modules and forms in "WordTools.dotm".  it has no visual design to it as it is used as a global tools template (a shortcut to this template is placed in the microsoft office\startup folder).  i am also compiling and signing the code with a digital signature before saving.

99 times out of 100 this template will open and save fine, but occasionally this error occurs and i lose all code (thankfully we use Subversion).  after the error dialog is closed the template appears to open ok, but is is in fact missing the entire code project.  in the VBA IDE there is nothing, not even a project for this template.

3 questions...

why is this happening?

how can i prevent it from happening?

how can i get my code back when it happens?

Windows XP SP8

Word 2007 (12.0.4518.1014)

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

2 answers

Sort by: Most helpful
  1. Anonymous
    2011-04-04T09:03:55+00:00

    thanks doug, but i think you're misunderstanding the problem here.  my template loses all of the code in it!  there is no VB project when i open the template and open the VBA IDE.....  there are no code modules, forms or classes.  nothing.   the template size shrinks to 38k, which also confirms that the code has been removed.

    whether or not the actual file is kept in the startup folder or the shortcut is irrelevant as i am opening the template itself from another folder in my c drive.

    i need to know why the entire code project gets removed, how to prevent this (if possible) and how can i get it back?

    thanks

    matt

    Was this answer helpful?

    0 comments No comments
  2. Doug Robbins - MVP - Office Apps and Services 323.1K Reputation points MVP Volunteer Moderator
    2011-04-01T21:23:06+00:00

    You should save the template itself in the Word Startup folder.  It will then automatically be loaded as an add-in when Word starts.

    Was this answer helpful?

    0 comments No comments