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

Word 2002 - Style visibility by DA

DA
Thu Jul 01 00:46:36 CDT 2004

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

>-----Original Message-----
>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
>.
>

Re: Word 2002 - Style visibility by Klaus

Klaus
Thu Jul 01 15:56:25 CDT 2004

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



"Wolfgang Vogelgesang" <info@dialogika.de> wrote:
> 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



Re: Word 2002 - Style visibility by Wolfgang

Wolfgang
Fri Jul 02 04:59:04 CDT 2004

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

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

Gru=DF, Wolfgang

>-----Original Message-----
>Hi Wolfgang,
>
>I think the problem is that the task pane doesn't update=20
automatically.
>
>Some code that seems to force an update of the "styles=20
and formatting" pane
>in Word2002:
>Options.FormatScanning=3DNot(Options.FormatScanning)
>Options.FormatScanning=3DNot(Options.FormatScanning)
>
>(since it toggles twice, it doesn't change the original=20
setting)
>
>Word2003 seems to be even more badly broken.
>
>BTW, Steve Hudson has written a great article on the=20
task panes, especially
>with regard to their (meagre) VBA support:
>http://www.geocities.com/word_heretic/TaskPanesVBA6.zip
>
>Gru=DF,
>Klaus
>
>
>
>"Wolfgang Vogelgesang" <info@dialogika.de> wrote:
>> 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 =3D=20
True
>>
>> However, if you run this macro, the visibiliy of the
>> Footnote Text style is not modified.
>>
>> Thanks in advance for any hint.
>>
>> Wolfgang
>
>
>.
>

Word 2002 - Style visibility by anonymous

anonymous
Fri Jul 02 05:01:01 CDT 2004

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

>-----Original Message-----
>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
>
>>-----Original Message-----
>>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
>>.
>>
>.
>

Re: Word 2002 - Style visibility by Klaus

Klaus
Mon Jul 05 20:48:12 CDT 2004

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



"Wolfgang Vogelgesang" <info@dialogika.de> wrote:
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