CommandBar.Reset dont work

M

Mike Londero

Hello!

I have a problem to Reset the CommandBars in MS Word 2003 (SP1) with a
VBA-Macro:

Dim oCmdBar As Office.CommandBar
For Each oCmdBar In Application.CommandBars
oCmdBar.Reset
Next

This code works fine with Windows 2000 (SP4) but have no effect on
Windows XP (SP2). Does anybody have the same problem?
Thank you.


Mike
 
C

Cindy M -WordMVP-

Hi Mike,

I'd be very surprised if the version of Windows made any difference. I
think it's more likely a question of which CustomizationContext is
available on the machine / for the profile. You should specifically set
the CustomizationContext in Word before you make any changes to command
bars.
I have a problem to Reset the CommandBars in MS Word 2003 (SP1) with a
VBA-Macro:

Dim oCmdBar As Office.CommandBar
For Each oCmdBar In Application.CommandBars
oCmdBar.Reset
Next

This code works fine with Windows 2000 (SP4) but have no effect on
Windows XP (SP2). Does anybody have the same problem?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

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

Mike Londero

Hello Cindy,

Bingo! :) I'll added the following line at the top and it works:

Application.CustomizationContext = ActiveDocument

Thank you very much,
Mike
 

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