Set Word Options in VBA for Word 2007

C

Cora

I've created a macro to set Word Options to my needs in Word 2007. It
includes most of the properties settings for Options object and some
properties settings for Application & Window/View object. It runs VERY SLOW.
I stepped through each line of codes and found half of the settings take
several seconds to finish. The similar macro I created for Word
97/2000/2002/2003 run very smoothly, took just a second to finish all. I've
noticed the message "conneting to printer .." shown on the status bar when
the macro run and tried to turn off "Application.ScreenUpdating", no
difference. Does any one know how to fix this problem?

Thanks in advance.
 
G

Graham Mayor

Why should this macro be necessary? Word 2003 had a few issues with the
registry entries being randomly changed (probably as a result of the data
key being adversely affected by errant add-ins), but I don't recall seeing
any reports of this occurring with other Word versions. Wouldn't you be
better simply backing up the Word data key from the registry, and forget
your macro?

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
C

Cora

The macro does more than just the settings stored in the "Data" key.
Besides, the "Data" key might store something I do not want to "reset". This
macro is meant for the end users to "reset" the Word settings to certain
standard of the firm whenever they feel need it. Although it will not be
hard to write a macro to restore the "Data" key to certain value, I have not
found the documentation of what information stored in "Data" key and in what
way, it is binary. I do know that it gets corrupted some time. Do you know
where I can find the documentation? And maybe I can modify the registry
instead of Word Object to speed up the process.

Thanks again.
 
D

Doug Robbins - Word MVP

If it is only something that is done occasionally for the purpose that you
mention, why worry about the performance.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
G

Graham Mayor

I agree - in any case, user settings are none of your business. Company
standards are best maintained by providing proper templates for the required
tasks and training the staff in their use. How they have their copy of Word
set up is a matter for them. Thus you should only need to setup a user
environment rarely.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
C

Cora

Although users do not run this macro daily, however, it is very handy when
they get very creative and start to try to set the options that will either
cause some problems or conflict with firm's standard (like use straight quote
or smart quote, etc.). In reality, this macro is being run more often than I
wish. It is a concern because it takes 7 minutes and my own experience is
that I'll terminate the process when it takes that long. However, I've
figured out the problem due to the prompt of "conneting to printer"; somehow
Word will try to connect to printer in many of the settings, I happened to
set the default printer on my Vista PC to a shared printer on a Windows xp on
network, the connection is slooooooow. When I reset the printer to a local
one (I do not really have one, so I set it to "fax"), then the macro finishes
in a minute. Although it is still not as fast as in 2000/2003, at least it
is acceptable now. I still don't understand the needs to connect to printer
for most of these settings, such as MeasurementUnit, ...etc. It will be
great if any one can tell me how to turn that off ...
 
B

Bear

Cora:

I don't have specific code, but could you record the printer at the start of
the macro, change it to a local printer, then switch it back at the end? We
all have Adobe PDF installed here, for example.

Bear
 
C

Cora

That is exactly what I did and it reduced the time from 7 minutes to 1
minute. Pretty dramatic. I've tried to turn off the background printing and
no difference. I've posted the same question to MS support, but most likely
I need to pay for the answer because it involves the programming. I'll
continue research this issue and if any one has better idea, please let me
know. I really appreciate it.
 

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