Word 2002 - Style visibility

  • Thread starter Wolfgang Vogelgesang
  • Start date
W

Wolfgang Vogelgesang

Hi,

the visibility of styles in Word 2002's Styles and
Formatting task bar can be controlled as follows:
- open the task bar's "Show" combo box
- choose "Custom..."
- now you can select which styles are to be visible for
the "All styles" category, for example

If you record this, the macro contains lines like this:
ActiveDocument.Styles("Footnote Text").Visibility = True

However, if you run this macro, the visibiliy of the
Footnote Text style is not modified.

Thanks in advance for any hint.

Wolfgang
 
D

DA

Hi Wolfgang

The switching of the styles view isn't supported by VBA.
Nor is there a visibility attribute associated with the
style object (even though the macro recorder seems to
think so).

Hmm.. I'd be interested in hearing what MS or the MVPs
have on this. Have you lodged a support call with MS?

Regards,
Dennis
 
K

Klaus Linke

Hi Wolfgang,

I think the problem is that the task pane doesn't update automatically.

Some code that seems to force an update of the "styles and formatting" pane
in Word2002:
Options.FormatScanning=Not(Options.FormatScanning)
Options.FormatScanning=Not(Options.FormatScanning)

(since it toggles twice, it doesn't change the original setting)

Word2003 seems to be even more badly broken.

BTW, Steve Hudson has written a great article on the task panes, especially
with regard to their (meagre) VBA support:
http://www.geocities.com/word_heretic/TaskPanesVBA6.zip

Gruß,
Klaus
 
W

Wolfgang Vogelgesang

Thank you, Klaus, in particular for the link to Steve
Hudson's very interesting article.

Unfortunately, your proposal for refreshing the task pane
does not seem to work with the Visibility property.

Gruß, Wolfgang
 
G

Guest

Hi Dennis,

in the meanwhile, I found an article of MVP Cindy Meister
telling that this hidden Visibility property doesn't work
with VBA.

Regards, Wolfgang
 
K

Klaus Linke

Hi Wolfgang,

Weird! I though I had tried it before, but it doesn't work now.
Even stranger, a style vanishes from the list if I set the visibility to
True!?!

With ActiveDocument
.FormattingShowFilter = wdShowFilterStylesAvailable
.Styles(wdStyleFootnoteText).Visibility = True
End With
StylesAndFormattingRefresh

Public Sub StylesAndFormattingRefresh()
' from Steve's article below
SendKeys "{Enter}"
Dialogs(wdDialogFormatStylesCustom).Execute
End Sub

But I can't make a style visible again from a macro :-(

Do you have a link to Cindy's article? I don't think I have seen it yet,
and can't find it on her site or the MVP site.

Steve's article is up on the MVPs' site:
http://www.word.mvps.org/faqs/macrosvba/taskpanesreferencecontent.htm
I took his code for updating the task pane instead of mine... It seems more
"readable".

Regards,
Klaus



Thank you, Klaus, in particular for the link to Steve
Hudson's very interesting article.

Unfortunately, your proposal for refreshing the task pane
does not seem to work with the Visibility property.

Gruß, Wolfgang
 

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