PDA

View Full Version : Programmatically Update Normal.dot ?



dorkboy
12-11-2007, 02:40 PM
Users have a macro in their Normal.dot file that consists of: (1) form, (2) .bas module, and (3) a class module.

If changes are made by the developer to any (or all) of the above 3 files, the 3 files are then exported to a network drive.

When the macro is run, we have logic in place to detect if any of the above 3 files have changed. If a new version of the above 3 files is detected, we want to programmatically:

(1) Remove all 3 (old) files from Normal.dot
(2) Import all 3 (new) files from the network drive into Normal.dot
(3) Set a Reference to "Microsoft ActiveX Data Objects 2.8 Library"

Can this be done programmatically or are we just dreaming?

TonyJollans
12-11-2007, 06:07 PM
It could be done - but the user would have to allow VBA access to the Project and that can't be set programmatically.

You should have all this in a global template other than normal. You could then work with the template rather than the components.

dorkboy
12-12-2007, 10:25 AM
Tony:

Thanks for the idea - it works great!!