Code: Select all
Sub AutoExec()
Application.TaskPanes(wdTaskPaneFormatting).Visible = True
End Sub
If I run it with a document open, it displays the Styles Pane.
If I open and run the UserForm from my Navigation Pane Add-In, I can get the Styles Pane to display if there is a document open, otherwise the same error.
https://www.dropbox.com/s/an7i2jv601rk2 ... .dotm?dl=0
A curious thing is that if the Styles Pane is visible and I close all documents but leave Word open, the Styles Pane remains on the screen.
Hans, I think I may have raised this a number of years ago with you but if so, I've lost the solution.
I know at one time you gave me DoEvents and a delay macro, these are in the Navigation Pane Add-In.
The following seem to be equivalent:
commandbars("Styles").Visible
Application.TaskPanes(wdTaskPaneFormatting).Visible
Both can be read or set, but not when there is not a document open. Both seem to do the same thing.