Link to home
Start Free TrialLog in
Avatar of oaktrees
oaktrees

asked on

Word's Normal File Lost - Recovering the Many Macros: How to?

Hi,


I've lost my very well-tricked-out


Normal


template for Word.  Had lots of customizations.


Is there anyway to salvage it from file that are...


.docm


I mean, I'm guessing that a Macro enabled file made under that Normal.docm on this machine SHOULD (hopefully) have gotten all the Normal's Macros carried over when it was saved?


Am I right?


So far I have a few other backup spots to ransack.  But, as that progresses - is there any backdoor method of finding all those Macros from Normal before it got lost?  Some way they got ported over to another file behind the scenes, and are there - but just...not well-known?


FWIW - I CAN see THIS files as:


C:\Users\user\AppData\Roaming\Microsoft\Templates\~$Normal.dotm


Which would definitely FIT THE BILL!


I got so far as to download the 


Windows Recovery Tool 


but found the syntax examples all reference an E drive as destination?


winfr C: E: /n \Users\<username>\Documents\QuarterlyStatement.docx


If you think I can get the Normal file from the above tmp location and know how to write the syntax for 


winfr


where I ONLY have a C: drive, then I;m open to that, or any tool that can reach it.


Otherwise, I'm hoping the MAcros are in some 


,docm


file that I created.


Fingers crossed!


Sincerely,


OT








Avatar of madunix
madunix

Consider taking a look at  Microsoft's support; if you need more detailed information:

https://support.microsoft.com/en-us/windows/recover-lost-files-on-windows-10-61f5b28a-f5b8-3cc2-0f8e-a63cb4e1d4c4

you should be able to open a document created with the original template, delete all the text & save as a new Normal.dotm


I'm not clear how you go about losing a Normal.dotm file. The file you see that is prefaced with ~$ is the temp file created from Normal.dotm when you open it in Word. With Word closed, you can try renaming it to Normal.dotm to see if there is recoverable content. 


Did the problem originate with an Office update? Some Word updates create a new blank Normal.dotm, but when they do, they first make a copy of your old Normal file. Check your Office templates for a Normal.dotm that has an 8 or 9 digit number appended to the name. You can use the Organizer to copy your macros back to your new Normal template. Please post again if you need help doing this.


I back up my Normal.dotm file on a regular basis to avoid this kind of problem. You can also create a separate DOTM file specifically for storing macros, then keep it in the Word Startup folder to automatically load it when you start Word. Then changes to Normal leave your macros unaffected.

Paul Sauve is mistaken about creating your own Normal.dotm file. Instead, you should always let Word create the file, then use the Organizer to copy styles and macros back into it.

thank you John. i sent you a private message concerning my answer

Avatar of oaktrees

ASKER

Hi ALL!


Madunix!  Ah!, yes.  Saw that link.  Key thing is the syntax.  It keeps referencing the E: drive as the recovery location.  My E: drive is on my desk at the office today. :P :D  I'll try with a USB I have lying about.  That may do the trick.  Do you know how I could re-write the syntax with ONLY a C: drive?


Paul!  Ah, tried.  Alas - they show up as blank in terms of Macros.

User generated image

John!  Ah!  You should write an article about this - it sounds really clever: YOU CAN ALSO CREATE A SEPARATE DOTM FILE SPECIFICALLY FOR STORING MACROS, THEN KEEP IT IN THE WORD STARTUP FOLDER TO AUTOMATICALLY LOAD IT WHEN YOU START WORD. THEN CHANGES TO NORMAL LEAVE YOUR MACROS UNAFFECTED.


Loss was just due to inattention on my part.  I knew the file had problems, but my full-drive auto-backups proceeded apace, AND auto-deleting to save space! :P :)) I just got past the point at which I had the unaffected file. :(...


Here's hoping on that temp file, or any alternatives! :D


Sincerely,


OT

Take the following points into consideration:

- Source and destination drives must be different.

- When recovering from a drive, use the /n <filter> switches to specify the user files or folder.

- Windows automatically create a recovery folder named “Recovery_<date and time>” on the destination drive.


Hi Madunix,


Ah!  I just realized something.  I don't need to FIND the file.  I do know where it is:


Users\user\AppData\Roaming\Microsoft\Templates\~$Normal.dotm


What I need is some way to get that emporary file to...


UN-temporary itself.


So that it goes from 


temp


back to


.dotm


What tools should I use?


Sincerely,


OT 

i would copy it to another location ( to have a backup)

then remove the $ sign and copy it to it's normal location, and test it

SOLUTION
Avatar of madunix
madunix

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi All,

Nobus! Hiya!
Tried that.  Didn't work:
It's THERE?
But, I can't see it or re-name it.
User generated imageUser generated image
Dr. E!  

Saw that Idea.  It sounds super solid.  Can't quite see it in my head.  Once I get this thing solved I'm going to give it a try.  Googled it a bit - did this fellow do it justice: https://wordribbon.tips.net/T012994_Using_the_Organizer_to_Manage_Macros

Madunix!
Tried winfr. Didn't work. Please see below.  But!  More importantly - it appears that what I want to do is not RECOVER a LOST file - but to make VISIBLE a temporary file.  So, this may not be the tool for me, right?  I mean - does

winfr

restore EXISTING files, or just search old Windows installations for *hopefully* RETRIEVABLE files.

Put another way - do we use winfr to make a temporary file visible, or to GET an archival copy of a lost file?

User generated image
MORE SIGNIFICANTLY... BIG NEWS:

I  F O U N D  A  C O P Y

of Normal.

Alas - it is acting abnormal?

Here's where I'm at now -

I've got a copy of normal from August of 2021.

Thing is - everytime I rename the autogenerated

Normal.dotm

file in Word, so I can drop in my recovered version, it keeps recreating a fresh / blank

Normal.dotm

which is taking over the duties.

Put another way - Normal keep recreating itself and overriding the Normal I'm trying to us.

What do you think is happening?

Sincerely,

OT

If Word doesn't find a Normal template when it starts, it just recreates a new "factory version" of Normal. I recommend saving a copy of your Normal from time to time (i.e. with a name like "Normal at 2023-01-12.dotm") so you have a snapshot of it for that date just in case.


Here are a few of my bookmarked resources related to templates, add-ins, and managing VBA modules that may be help provide some background for why the "wordribbon" article tips would be useful. Although some are old, they provide good background about how things work.


  • Word MVP site: What do Templates and Add-ins store? (https://wordmvp.com/FAQs/Customization/WhatTemplatesStore.htm) Article was created for much earlier versions (i.e. Word 97), but updated for Word 2002. The table showing what templates and add-ins store is useful (& relevant even in more recent versions).
  • Word MVP site: Organizing your macros (https://wordmvp.com/FAQs/MacrosVBA/OrganizeMacros.htm) This circa Word 2007 era article has some good tips about organising VBA code within templates and add-ins, and some basic code examples to show how to set up a simple user form to more easily load regularly used templates. This works for Word 2010, but note that the suggestion about the “Work Menu” at the end is no longer relevant in later versions (where the ribbon can be customized).
  • S Barnhill site: How (and why) to create a template in Word (http://wordfaqs.ssbarnhill.com/CreateTemplate.htm) This 2015 article covers details about the topic for older versions of Word, but has been updated for up to Word 2016. Good background about templates.
  • Reddit thread about understanding Modules and Subs (https://www.reddit.com/r/excel/comments/93cyje/learning_vba_and_trying_to_understand_modules_and/) The thread is about Excel VBA, but applies to Word. Useful for basics related to why a template might have multiple modules containing VBA Subs and Functions.
  • Greg Maxey’s overview of Word VBA (https://gregmaxey.com/word_tip_pages/vba_basics.html) Easily-understood explanations about the basics, with good code snippet examples and links to more relevant detail for many of the topics. An easy read, and a very useful primer to the topic. (I would have liked a table of contents to more easily navigate the useful information!)
  • Training Hub article about calling a VBA Sub or Function from a different VBA module (https://gregmaxey.com/word_tip_pages/vba_basics.html) This was prepared for Excel VBA, but applies equally to Word. Useful for getting at code that I created from a different purpose saved in a different module!


ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi Eric & John!

ERIC!  Wow!  GREAT stuff there.  Thank you for these.  :)))))))))))!

JOHN!  Ah!  Thank you for explaining that. :)))))))))))!


Lads, this is the thing I am confused about, though.  Take a look here.  On the left is the BEFORE - just before I opened Word.  I've got my "Legacy" normal template there, and the others commented out.

As soon as I OPEN word, it just runs roughshod over my poor wee Normal file and recreates it's OWN file.

User generated image
I'm guessing the thing to do , obviously, is to follow your and Eric's advice to get the Macros into the Organizer.  I'm going to do that.

But, want to find out why I can't just drop in my own Normal like I always used to be able to do .

What do you think is happening?

Sincerely,

OT

Is it possible your view is ignoring part of the file extension? 


When I used Everything (hand free app to find files on my system from VoidTools), it displays a new file named "Normal.dotm.lnk" created immediately as I started Word. I assume it is just a pointer to the actual template, and it doesn't appear in a File Explorer view (or at least not with the defaults I have set).

User generated image


As I wrote on Saturday, "you should always let Word create the file, then use the Organizer to copy styles and macros back into it." Normal.dotm is not a stock word file that you can create with a File>Save As.
Hello EXPERT EXPERTS!

PLEASE ACCEPT THE

EGOT!

User generated image
Emmy-Grammy-Oscar-Tony!

So, I opened that OTHER old normal that I'd found - from 8/22 which means it really had EVERYTHING I use on a daily basis - copied them into the developer tab's macro and SEEMS like they'll stick there. (?)

Eric!
YEAH!  FINALLY I was using a piece of software that you already use!  Voidtools Everything is sort of like voodoo, no?  Can't imagine why it's not SOLD, or BOUGHT yet by Windows!  I even chipped in some cash just because the thing is so doggone useful, eh?

So, sounds like you don't keep ALL those macros active all the time and you're using the organizer to GET the ones you need based on the project.  Am I right?

On a daily basis...how may macros do you have in Word ALWAYS active?

PAUL!
Thanks for the tip on saving the macros in ANOTHER template.  That's clever!

T H A N K S  A G A I N to all!

Sincerely,

OT



Yes, VoidTools "Everything" is very handy utility — and good for you for supporting them with a donation!


My Normal template has a number of different modules within it. Some are there fairly permanently: my cleanText module is a legacy macro I initially created in WordBasic in the 90s to clean up common problems in English, French and Spanish documents. Some of the code is still in WordBasic, but it works fine. A Utilities module has 47 Subs: most are quite small, and do things like toggle optional settings or do bulks actions like remove hidden bookmarks, change shape attributes, or normalize page setup attributes for all sections. The default NewMacros module currently has 63 Subs: some of these are just for testing some VBA code or Q&D recorded macros — and I periodically go through them to cull the junk and move the useful stuff to other modules or to specific utility templates. One module contains just one "macro": MacroCodingTips doesn't do anything at all, but contains snippets of commented VBA code to do specific common tasks. I maintain it as a "tips repository" so I can copy & paste from it to get already-commented code. It also gets backed up periodically.


Specific templates contain much more focused code though, and get attached as add-ins when needed. When I start a new job, my CleanUp template has more specific code to do the sort of tasks I typically need at that stage: stripping out formatting and extraneous "keyboard entry" content; applying styles according to various rule patterns; managing foreign-language content with custom character styles; marking page and section breaks with codes before stripping them out to rationalize page setup attributes; etc. Some macros are duplicates of what I have in Normal, and as I adjust them in Normal, I decide whether to migrate them over to CleanUp.


Other templates have specific tools for massaging content for e-book publishing, creating and managing an index, bulk find & replace, etc. I've never really counted the number of unique Subs I have, but I imagine it must be several hundred.