View Single Post
 
Old 06-05-2023, 07:26 AM
Charles Kenyon Charles Kenyon is offline Windows 11 Office 2021
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,140
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

Quote:
Originally Posted by Guessed View Post
I did get an error initially on 365 but then it worked.

I think if you add an
On Error Resume Next

and then re-enable the TaskPanes line then I expect either one or both will work and if it errors then the second one gets it done anyway.

Andrew,
Thank you for the suggestion.


SpeakEasy, in Eileen's Lounge, suggested:
ActiveDocument.CommandBars.ExecuteMso "StylesPane"


Nothing with the Styles Pane will work in AutoExec because there is no document open and Word won't display the Styles Pane without an open document. Once a document is open and the StylesPane has been activated in some manner, apparently both visible and width work.
Reply With Quote