Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-17-2021, 11:24 AM
NitroPress NitroPress is offline Set width of Styles pane? Windows 10 Set width of Styles pane? Office 2010
Novice
Set width of Styles pane?
 
Join Date: Nov 2019
Posts: 22
NitroPress is on a distinguished road
Default Set width of Styles pane?

I have a setup macro that puts the Navigation pane on the left, at a defined width, and the Styles pane on the right, again at a preferred width, and then sets the page size. Under Office 2010, I had this working, but with the forced update (I went to 2016), I'm stuck.




Nav pane up, check. Set width using:
Code:
With Application.CommandBars("Navigation")
        .Visible = True
        .Width = iWidth
     End With
...no problem.


Scale page zoom, no problem.


Open Styles pane with:
Code:
Application.TaskPanes(wdTaskPaneFormatting).Visible = True
...no problem.


But even with several years of VBA hacking and Mansfield's fat book at hand, I can't figure out how to set the width of the Styles pane.


Specific answer appreciated; some hints about how to chase the object list for "task panes" (instead of CommandBars, for example) appreciated...
Reply With Quote
  #2  
Old 06-17-2021, 04:43 PM
Guessed's Avatar
Guessed Guessed is offline Set width of Styles pane? Windows 10 Set width of Styles pane? Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,966
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

You were close
Code:
  With Application
      .TaskPanes(wdTaskPaneFormatting).Visible = True
      .CommandBars("Styles").Position = msoBarRight
      .CommandBars("Styles").Width = 400
  End With
I found the clue to shift to CommandBars here Keeping the Styles Pane Open by Default (Microsoft Word)

For some hints that explore the vba Task Pane limits, here is another link. Although it appears to have been written in 2004, Word's development tends to move at a glacial pace so it is probably still current. Word’s Task Panes VBA Reference – Content
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #3  
Old 06-17-2021, 04:55 PM
NitroPress NitroPress is offline Set width of Styles pane? Windows 10 Set width of Styles pane? Office 2016
Novice
Set width of Styles pane?
 
Join Date: Nov 2019
Posts: 22
NitroPress is on a distinguished road
Default

Aces, thanks!


It's those switches in object name that throw me.
Reply With Quote
  #4  
Old 06-17-2021, 05:00 PM
Guessed's Avatar
Guessed Guessed is offline Set width of Styles pane? Windows 10 Set width of Styles pane? Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,966
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

And it is a good thing that logic breaks throw you - it shouldn't make sense to switch objects.

You would think with the resources that MS have, someone would be tasked with fixing omissions and inconsistencies like this in the VBA object model
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Set width of Styles pane? Word 2010 - Styles pane has disappeared NitroPress Word 5 11-21-2019 04:16 PM
How to have one custom styles pane for all documents? deazzxe Word 1 04-09-2019 05:20 AM
Two much blank space between names of styles in the Styles Pane PereCasanellas Word 0 10-06-2017 03:47 AM
Using the Navigation Pane with modified styles susandickerson Word 3 07-10-2014 08:35 PM
Can't Display "Recently Used Styles" in Styles Pane mwildem Word 2 05-23-2012 01:42 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:24 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft