Automating a transfer of vba code between normal.dot files

I

Ivan K

I am writing a Visual Basic program to roll out a standardised Normal.dot
file to a large number of users on a network. As part of the rollout I want
to ensure that users are disrupted as little as possible so I have written a
program that exports autocorrect, autotext and key binding entries, copies
over the new normal.dot file (after renaming the old one) and then imports
everything into the new file.

I would also like to transfer any VBA code from users' old Normal.dot file
to the new one, using the same program. As far as I can tell this is not
possible but if anyone would like to prove me wrong I would be happy to hear
from them...

Thanks,

Ivan
 
I

Ivan K

On the other hand, if someone knows that this isn't possible I would
appreciate them saying so.

Ivan
 
C

Cindy Meister -WordMVP-

Hi Ivan,
I would also like to transfer any VBA code from users' old Normal.dot file
to the new one, using the same program. As far as I can tell this is not
possible but if anyone would like to prove me wrong I would be happy to hear
from them...
Have you tried using OrganizerCopy? You'd probably also need to use the
VBProject.VBComponents of the vBExtensibility library to get a list of
modules, forms, etc. And you may need to do this while neither file is named
"Normal.dot". There are some restrictions on direct manipulation of Normal.dot
(due to macro viruses).

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jan 24 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
I

Ivan K

Thanks very much for your help, Cindy.

I have hit a roadblock, though. When I try to access project components
using Application.ActiveDocument.VBProject.VBComponents I get the error
"Programmatic access to Visual Basic Project is not trusted". Clearing the
"Trust access to Visual Basic Project" checkbox under Tools -> Options ->
Security -> Macro Security -> Trusted Sources gets rid of this error,
however having to go around changing this setting in everyone's profile
would defeat the purpose of the project somewhat.

Does anyone know if this setting can be changed by a script? I realise that
the answer is probaby "of course not, what would be the point of having the
setting if you could change it from a script", but it never hurts to ask...

Ivan
 
C

Cindy Meister -WordMVP-

Hi Ivan,

I'd guess this setting could be changed for the user profiles ona network
using a POLICY, but I don't know any details on it. You might try asking in
an office.setup newsgroup. Or looking in the Office Resource Kit.
I have hit a roadblock, though. When I try to access project components
using Application.ActiveDocument.VBProject.VBComponents I get the error
"Programmatic access to Visual Basic Project is not trusted". Clearing the
"Trust access to Visual Basic Project" checkbox under Tools -> Options ->
Security -> Macro Security -> Trusted Sources gets rid of this error,
however having to go around changing this setting in everyone's profile
would defeat the purpose of the project somewhat.

Does anyone know if this setting can be changed by a script? I realise that
the answer is probaby "of course not, what would be the point of having the
setting if you could change it from a script", but it never hurts to ask...

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top