Macro recorder saves wrong properties for style pane options?

S

shmuel

In Word 2007 (with SP2 installed), I used the macro recorder to generate code
that changes the "styles to show" options in the Styles task pane. However,
it seems that the wrong code was generated.

When I chose "Recommended", macro recorder wrote
ActiveDocument.FormattingShowFilter = wdShowFilterStylesAvailable
instead of
ActiveDocument.FormattingShowFilter = wdShowFilterFormattingRecommended

When I chose "In use", macro recorder wrote (correctly)
ActiveDocument.FormattingShowFilter = wdShowFilterStylesInUse

When I chose "In current document", macro recorder wrote
ActiveDocument.FormattingShowFilter = wdShowFilterStylesAll
instead of
ActiveDocument.FormattingShowFilter = wdShowFilterStylesAvailable

When I chose "All styles", macro recorder wrote
ActiveDocument.FormattingShowFilter = wdShowFilterFormattingInUse
instead of
ActiveDocument.FormattingShowFilter = wdShowFilterStylesAll

I determined the correct values by trying the different commands in a macro
and observing what setting was changed in Word.
Any idea what is going on here? Is this is a known bug in Word that can be
duplicated on other PC's?

Thanks for any help.
 
J

Jay Freedman

Hi Shmuel,

Yes, it's a reproducible bug. I doubt that it's known, as I haven't seen any
other posts on this topic since Word 2007 was released. You can report it to
Microsoft at
https://feedback.office.microsoft.com/default.aspx?productkey=office2007&scrx=1
but I doubt anything will be done about it other than perhaps a KnowledgeBase
article.

As it is, I think we're lucky that this option can be set through VBA at all. In
the last few releases, VBA support for new features -- especially in the
recorder -- has generally been absent or only partial, rather than simply wrong.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so all
may benefit.
 
S

shmuel

Thanks, Jay.

I think Microsoft is lucky that developers are willing to put up with buggy
or missing features in Word. :)
 

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