Multiple style galleries in a single ribbon tab in Word 2010

I would like create multiple drop down style lists in a Word 2010 ribbon tab (like I could in 2003 toolbars). Is this possible using the standard Word 2010 tools or will I have to write reems of code? Is there any documentation that I could read that would give me some clarity?
helpixAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

GrahamSkanRetiredCommented:
I don't have 2010, but in 2007, you can click on Change Styles and select Style Set. Here you can select from Sets or add your current style as a 'quick' style.
0
helpixAuthor Commented:
Thanks for getting back to me so quickly Graham.

I don't want to add or change the styles I want to be able to group existing styles together in handy drop down lists rather than scroll up and down the long list in the styles window (see 2003 example attached).

With thanks
Helpix Style-toolbar.docx
0
GrahamSkanRetiredCommented:
If you click on the dropdown arrow between the Styles display panel and the 'Change Styles' button, you do see all the styles in the current set without having to scroll.
0
Learn SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

helpixAuthor Commented:
Hi Graham

I'm aware of the Style Gallery but it's not giving me what I want.

I have over 275 user styles and I want to be able to group them into small relevant drop down lists like I used to be able to do in 2003 by creating toolbars containing menus listing specific styles. Is there anything that will let me do that in 2010?

Is there any documentation that will give me some guidance as to where this functionality has moved to in 2010?

Failing that do you know of anyone doing this with VBA?
0
GrahamSkanRetiredCommented:
Here is an unfinished VBA example.

It is a Userform that lists all the available styles in a combobox (main). There are four other comboboxes with an 'Add' command button above each. The comboboxes can each hold a list of styles, which have been stored in the registry.


The Add button will add to its associated combobox the selected style from the main combobox. Clicking on the style name in one of the individual boxes will apply the style to the Selection. Note the only the first combobox code has been implemented.

The Save button will save the lists from the four comboboxes to the registry.



frmStyles.frm
frmStyles.frx
0
helpixAuthor Commented:
Thank you for taking the time to show me the combo boxes/registry option as a solution for my issue.

I'm afraid the registry isn't something I can use. The style lists need to be available on a ribbon or QAT, generated from the styles within the template. This is for version control reasons.

In 2010 there is no longer the option of making user defined toolbars of styles so I am hoping someone can point me in the direction of something that will help me generate these lists of styles automatically from the list of styles in the template as menus or drop down lists on a ribbon.

The styles have been grouped together through the use of priority numbers.
0
GrahamSkanRetiredCommented:
You can have a call macros from a QAT button. e.g.

Sub OpenForm()
   frmStyles.Show
End Sub

It would be possible to save the names as document variables in  a document or a template. I'll try to tweak the code to show how.
0
helpixAuthor Commented:
Thanks for your attention on this. I don't want to save 275 document variables, I just want to list the styles that are shown in the Styles Window in grouped lists from a ribbon so that users can select them just like the old 2003 toolbars. I don't want to save anything anywhere.

It's an ease of use thing now that 2010 no longer provides an easy to use interface for grouping styles together. The Styles Window is unmanageable with 275 styles listed, even when they are grouped together.

I know exactly what I want, I just can't seem to find a simple way to produce the grouped styles.

0
GrahamSkanRetiredCommented:
On a philosophical point, your choices must be saved somewhere. Obviously if you need to distribute the style grouping, the registry won't do it. Saving as document variables is a mechanism to ensure that your selections are saved in a template/document so that they can be distributed. It would not be visible unless the code is examined.

0
GrahamSkanRetiredCommented:
0
GrahamSkanRetiredCommented:
This demonstrates the use of document variables to keep your settings. Currently it saves in the ActiveDocument.

You may also want to eventually have two versions, one for you, where you can group the styles, and one for your clients who don't need to do that.

Option Explicit
Dim doc As Document

Private Sub cmdSave_Click()
    Dim Settings As Variant
    Dim i As Integer
    
    Settings = MyGetAllSettings("Group1")
    If Not Settings = Empty Then
        For i = 0 To UBound(Settings)
            doc.Variables(Settings(i)).Delete
        Next i
    End If
    For i = 0 To ComboBox1.ListCount - 1
        doc.Variables.Add "Group1_" & i, ComboBox1.List(i)
    Next i
End Sub

Private Sub ComboBox1_Click()
    If ComboBox1.Text <> "" Then
        Selection.Style = ComboBox1.Text
    End If
    DoEvents
End Sub

Private Sub CommandButton1_Click()
    If cboStyles.Text <> "" Then
        ComboBox1.AddItem cboStyles.Text
    End If
End Sub

Private Sub UserForm_Activate()
    Dim sty As Style
    Dim Settings As Variant
    Dim i As Integer
    
    Set doc = ActiveDocument
    
    For Each sty In doc.Styles
        cboStyles.AddItem sty.NameLocal
        cboStyles.List(cboStyles.ListCount - 1, 1) = sty.Type
    Next sty
    
    Settings = MyGetAllSettings("Group1")
    If Not VarType(Settings) = Empty Then
        For i = 0 To UBound(Settings)
            ComboBox1.AddItem doc.Variables(Settings(i)).Value
        Next i
    End If
    
    Settings = MyGetAllSettings("Group2")
    If Not VarType(Settings) = Empty Then
        For i = 0 To UBound(Settings)
            ComboBox2.AddItem doc.Variables(Settings(i)).Value
        Next i
    End If
    
    Settings = MyGetAllSettings("Group3")
    If Not VarType(Settings) = Empty Then
        For i = 0 To UBound(Settings)
            ComboBox3.AddItem doc.Variables(Settings(i)).Value
        Next i
    End If
    
    Settings = MyGetAllSettings("Group4")
    If Not VarType(Settings) = Empty Then
        For i = 0 To UBound(Settings)
            ComboBox4.AddItem doc.Variables(Settings(i)).Value
        Next i
    End If
End Sub
Function MyGetAllSettings(strGroup As String)
    Dim dv As Variable
    Dim strVarBits() As String
    Dim VariableNames() As String
    Dim i As Integer
    
    For Each dv In doc.Variables
        strVarBits = Split(dv.Name, "_")
        If strVarBits(0) = strGroup Then
            ReDim Preserve VariableNames(i)
            VariableNames(i) = dv.Name
            i = i + 1
        End If
    Next dv
    If i > 0 Then
        MyGetAllSettings = VariableNames
    End If
End Function

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
helpixAuthor Commented:
From carrying out extensive research I can see that it's not possible to create the same style toolbars that were created in Word 2003 which is a massive shortcoming of 2007 and 2010.

I don't need to save the style groupings, I just need to show a subset of the styles in the ribbon so that a user can select and apply the style to their text.  Do you think dynamic menus would work using arrays, style priority and XML?

If so, do you know of anyone who is creating code specifically for generating dynamic style menus using this method?
0
GrahamSkanRetiredCommented:
Yes, it is true that the old menu style has been dropped.

If you want to show a subset, who do you need to choose the members of the subset?

The concept now is that you only need a limited number of styles in any one document, and these styles can be grouped into sets.

There is a tool called Custom UI editor downloadable from Microsoft. which can be used to modify the ribbon. So far, I can make it add buttons that will call a macro. I haven't got as far as creating a combobox and filling it dynamically.
0
helpixAuthor Commented:
Unfortunately Microsoft's idea of Changing styles does not support the workflow that my client needs to follow.  I have to make all 275 styles available to the users, hence the groupings. I've tried a drop down list but it has shortcomings which is why I'm looking at dynamic menus. I would like to know if there are any shortcomings to these and using XML to dynamically generate sub groups of 275 styles as the template loads. I'd be interested if anyone has a good understanding of these.

And yes, I'm using the Custom UI already.

0
frankhelkCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Word

From novice to tech pro — start learning today.