none
In XML for Word addin ribbon is it possible to filter and display Building Block by Category with Previews RRS feed

  • Question

  • Word 2007 SP3

    In XML for Word addin ribbon is it possible to filter and display Building Block by Category with Previews

    Not sure which forum to post this Word or VB.net

    Menu 1 was created by someone thats now left the firm.
    The goal was to easily categorise and display building blocks. The building blocks where created and defined by Gallery customTypes. eg

    Menu 1
    Sub-menu1 = Gallery defined as Custom AutoText
    Sub-menu2 = Gallery defined as Custom Tables
    Sub-menu3 = Gallery defined as Custom Page Numbers
    Sub-menu4 = Gallery defined as Custom Table of Contents

     

    I need to create a new Menu 2 and organised by Categories eg

    Menu 2
    Sub-menu1 = Category1 = BuildingBlockTypes is Custom Tables
    [tab][tab][tab][/tab][/tab][/tab] BuildingBlockTypes is Custom Headers
    [tab][tab][tab][/tab][/tab][/tab] BuildingBlockTypes is Custom Footers

    Sub-menu1 = Category2 = BuildingBlockTypes is Custom Tables
    [tab][tab][tab][/tab][/tab][/tab] BuildingBlockTypes is Custom Headers
    [tab][tab][tab][/tab][/tab][/tab] BuildingBlockTypes is Custom Footers


    I need to add new building blocks. The building blocks are a specific category for example ‘Department’ however made up of different BuildingBlockTypes. eg the building blocks Gallery needs to be defined as Custom Table. The result is: the new building block is now picked up and displays in location

    Menu 1
    Sub-menu2 = Gallery defined as Custom Tables

    Whats the best way for me to achieve this?  :scratch:
    I can redefine Menu1 building blocks Gallery
    I would prefer using the XML with previews.
    Otherwise the alternative is to code to display a control menu and insert building blocks. With this method I lose the preview & the Preview is great for end users. see screen capture


     <group idQ="CustomRibbon:CustomWordGroupBB" label="Custom building blocks">
    
              <box visible="true" idQ="CustomRibbon:CustomWordGroupBB1" boxStyle="vertical">
              <box visible="true" idQ="CustomRibbon:CustomWordGroupBB1a" boxStyle="horizontal">
                           <button idQ="CustomRibbon:CustomWordTableOfContents" imageMso ="TableOfContentsGallery" tag ="ContentPage" label="&amp;TOC" onAction="OnActionCustomWordTableOfContents" screentip ="Table of Contents" supertip ="Table of Contents" />
                <menu idQ="CustomRibbon:CustomWordVisualTool" label="Visual Tools" imageMso="IndexInsert" screentip="Visual Tools" supertip="Insert tables, lists, timelines and charts in Custom styles">
                  <gallery imageMso="AppointmentColor5" idMso="CustomTablesGallery" label="Tables – orange header" />
                  <gallery imageMso="AppointmentColor10" idMso="CustomQuickPartsGallery" label="Tables – yellow header" />
                  <gallery imageMso="FilePrepareMenu" idMso="CustomAutoTextGallery" label="Lists" />
                  <gallery imageMso="SmartArtRightToLeft" idMso="CustomTableOfContentsGallery" label="Timelines" />
                  <gallery imageMso="SmartArtOrganizationChartStandard" idMso="CustomPageNumberGallery" label="Charts" />
                </menu>
              </box>

    XML menus display with previews

    thank you and regards,

    Tuesday, January 28, 2014 11:33 PM

Answers

  • Hi dd_

    There's nothing built into Word or Office that gives the developer an image of "any" building block content.

    From the Ribbon XML you provide it appears your predecessor used the built-in Gallery names for Building Blocks provided by Word and populated them with the content the company wants to provide to the users.

    So the only thing you can do is to work in a similar manner, providing your own LABELS to use with the idMso for the Gallery. I find the following Gallery control IDs for Word 2007 that appear to work with Building Blocks:

    AutoTextGallery
    CustomHeaderGallery

    CustomFooterGallery
    CustomCoverPageGallery
    CustomPageNumberGallery
    CustomPageNumberTopGallery
    CustomPageNumberBottomGallery
    CustomPageMargins
    CustomWatermarkGallery
    CustomEquationsGallery
    CustomTablesGallery
    CustomQuickPartsGallery
    CustomAutoTextGallery
    CustomTableOfContentsGallery
    CustomBibliographyGallery
    CustomTextBoxGallery
    CustomGallery1
    CustomGallery2
    CustomGallery3
    CustomGallery4
    CustomGallery5


    Cindy Meister, VSTO/Word MVP, my blog

    Wednesday, January 29, 2014 3:08 PM
    Moderator
  • Diana, no you cannot.

    You can assign the BBs to the template (advice) for orange and yellow. Or just consolidate what you have already to put on the Corrs ribbon.

    Move all the logos from Custom 1-4 (if I remember correctly) into Custom Bibliography (for example) as Logo Docs, Logo Letters whatever you choose to call them (Logo 1, Logo 2) whatever. That will free up Custom 1-5.

    I assume you are putting this on the Corrs ribbon addin as you have TOC which is on the firm ribbon addin.

    There are a couple of timelines for PowerPoint and Charts for PowerPoint or Word.

    For example Timeline 1, Timeline 2 - the timeline BBs will show one under the other no need to categorise you just rename the CustomGallery labels.

    Example:

    Logos = CustomBibliography

    Logo 1

    Logo 2

    Logo 3

    Logo 4 (all appear in the dropdown)

    Advice Headings = CustomTables

    Heading 1 Portrait

    Heading 1 Landscape

    Subhead 1 Portrait

    Subhead 2 Landscape

    Yellow 1 Landscape

    Yellow 2 Portrait

    Yellow 3 Subhead

    Timelines = Custom2

    Timeline 1

    Timeline 2

    Charts = Custom3

    Chart1

    Chart 2

    Chart 3

    xxx = Custom4

    bb 1

    bb 2

    etc. There are more than enough galleries  - one for Logos, one for Charts, one for Timelines, one for Advice template if you alter your thinking a little. 

        <

    group idQ="nsjaninecrutch:rxgrpBB2"label="Corrs Tools"


            

    insertBeforeMso="TabHome">

       <

    box id="boxJEC1"boxStyle="vertical">

    <

    button id="CustomWordTableOfContents"

    imageMso="TableOfContentsGallery"

    tag="ContentPage"

    label="&amp;TOC"

    onAction="OnActionCustomWordTableOfContents"

    screentip="Table of Contents"

    supertip="Table of Contents"/>

                <

    menu id="CustomWordVisualTool"

    label="Visual Tools"

    imageMso="IndexInsert"

    screentip="Visual Tools"

    supertip="Insert tables, lists, timelines and charts in Custom styles">

                  <

    gallery imageMso="AppointmentColor5"idMso="CustomTablesGallery"label="Advice- orange headings"/>

                  <

    gallery imageMso="AppointmentColor10"idMso="CustomQuickPartsGallery"label="Advice- yellow headings"/>

                  <

    gallery imageMso="FilePrepareMenu"idMso="CustomAutoTextGallery"label="Lists"/>

                  <

    gallery imageMso="SmartArtRightToLeft"idMso="CustomTableOfContentsGallery"label="Timelines"/>

                  <

    gallery imageMso="SmartArtOrganizationChartStandard"idMso="CustomPageNumberGallery"label="Charts"/>

                  <

    gallery imageMso="AppointmentColor1"idMso="CustomGallery1"label="Custom 1 Gallery CHANGE THIS LABEL"onAction="rxJECBB1"  />

                  <

    gallery imageMso="AppointmentColor2"idMso="CustomGallery2"label="Custom 2 Gallery CHANGE THIS LABEL"/>

                  <

    gallery imageMso="AppointmentColor3"idMso="CustomGallery3"label="Custom 3 Gallery"/>

                  <

    gallery imageMso="AppointmentColor4"idMso="CustomGallery4"label="Custom 4 CHANGE THIS LABEL"/>

                  <

    gallery imageMso="AppointmentColor6"idMso="CustomGallery5"label="Custom 5 Gallery CHANGE THIS LABEL"/>

                  <

    gallery imageMso="AppointmentColor5"idMso="CustomBibliographyGallery"label="Custom Bibliography CHANGE THIS LABEL"/>

                </

    menu>

    </

    box>

       </

    group>


    Thursday, January 30, 2014 2:53 AM
  • Hi dd

    <<If the building block footer is defined to a different gallery eg ‘CustomBibliographyGallery’

    The result is:

    The building block is inserted at the insertion point in the document.

    And not as expected in the documents footer.>>

    You should be able to use callbacks (onAction, getSelectedItemID, getSelectedItemIndex) in the Ribbon definitions for these galleries to run some code when a choice is made. This should let you insert a Footer, for example, in the correct StoryRange of the document.


    Cindy Meister, VSTO/Word MVP, my blog

    Friday, January 31, 2014 10:58 AM
    Moderator

All replies

  • Hi dd_

    There's nothing built into Word or Office that gives the developer an image of "any" building block content.

    From the Ribbon XML you provide it appears your predecessor used the built-in Gallery names for Building Blocks provided by Word and populated them with the content the company wants to provide to the users.

    So the only thing you can do is to work in a similar manner, providing your own LABELS to use with the idMso for the Gallery. I find the following Gallery control IDs for Word 2007 that appear to work with Building Blocks:

    AutoTextGallery
    CustomHeaderGallery

    CustomFooterGallery
    CustomCoverPageGallery
    CustomPageNumberGallery
    CustomPageNumberTopGallery
    CustomPageNumberBottomGallery
    CustomPageMargins
    CustomWatermarkGallery
    CustomEquationsGallery
    CustomTablesGallery
    CustomQuickPartsGallery
    CustomAutoTextGallery
    CustomTableOfContentsGallery
    CustomBibliographyGallery
    CustomTextBoxGallery
    CustomGallery1
    CustomGallery2
    CustomGallery3
    CustomGallery4
    CustomGallery5


    Cindy Meister, VSTO/Word MVP, my blog

    Wednesday, January 29, 2014 3:08 PM
    Moderator
  • Thanks Cindy

    Do you know if I can create additional CustomGalleries eg

    CustomGallery6

    CustomGallery7

    CustomGallery8

    Thursday, January 30, 2014 12:40 AM
  • Diana, no you cannot.

    You can assign the BBs to the template (advice) for orange and yellow. Or just consolidate what you have already to put on the Corrs ribbon.

    Move all the logos from Custom 1-4 (if I remember correctly) into Custom Bibliography (for example) as Logo Docs, Logo Letters whatever you choose to call them (Logo 1, Logo 2) whatever. That will free up Custom 1-5.

    I assume you are putting this on the Corrs ribbon addin as you have TOC which is on the firm ribbon addin.

    There are a couple of timelines for PowerPoint and Charts for PowerPoint or Word.

    For example Timeline 1, Timeline 2 - the timeline BBs will show one under the other no need to categorise you just rename the CustomGallery labels.

    Example:

    Logos = CustomBibliography

    Logo 1

    Logo 2

    Logo 3

    Logo 4 (all appear in the dropdown)

    Advice Headings = CustomTables

    Heading 1 Portrait

    Heading 1 Landscape

    Subhead 1 Portrait

    Subhead 2 Landscape

    Yellow 1 Landscape

    Yellow 2 Portrait

    Yellow 3 Subhead

    Timelines = Custom2

    Timeline 1

    Timeline 2

    Charts = Custom3

    Chart1

    Chart 2

    Chart 3

    xxx = Custom4

    bb 1

    bb 2

    etc. There are more than enough galleries  - one for Logos, one for Charts, one for Timelines, one for Advice template if you alter your thinking a little. 

        <

    group idQ="nsjaninecrutch:rxgrpBB2"label="Corrs Tools"


            

    insertBeforeMso="TabHome">

       <

    box id="boxJEC1"boxStyle="vertical">

    <

    button id="CustomWordTableOfContents"

    imageMso="TableOfContentsGallery"

    tag="ContentPage"

    label="&amp;TOC"

    onAction="OnActionCustomWordTableOfContents"

    screentip="Table of Contents"

    supertip="Table of Contents"/>

                <

    menu id="CustomWordVisualTool"

    label="Visual Tools"

    imageMso="IndexInsert"

    screentip="Visual Tools"

    supertip="Insert tables, lists, timelines and charts in Custom styles">

                  <

    gallery imageMso="AppointmentColor5"idMso="CustomTablesGallery"label="Advice- orange headings"/>

                  <

    gallery imageMso="AppointmentColor10"idMso="CustomQuickPartsGallery"label="Advice- yellow headings"/>

                  <

    gallery imageMso="FilePrepareMenu"idMso="CustomAutoTextGallery"label="Lists"/>

                  <

    gallery imageMso="SmartArtRightToLeft"idMso="CustomTableOfContentsGallery"label="Timelines"/>

                  <

    gallery imageMso="SmartArtOrganizationChartStandard"idMso="CustomPageNumberGallery"label="Charts"/>

                  <

    gallery imageMso="AppointmentColor1"idMso="CustomGallery1"label="Custom 1 Gallery CHANGE THIS LABEL"onAction="rxJECBB1"  />

                  <

    gallery imageMso="AppointmentColor2"idMso="CustomGallery2"label="Custom 2 Gallery CHANGE THIS LABEL"/>

                  <

    gallery imageMso="AppointmentColor3"idMso="CustomGallery3"label="Custom 3 Gallery"/>

                  <

    gallery imageMso="AppointmentColor4"idMso="CustomGallery4"label="Custom 4 CHANGE THIS LABEL"/>

                  <

    gallery imageMso="AppointmentColor6"idMso="CustomGallery5"label="Custom 5 Gallery CHANGE THIS LABEL"/>

                  <

    gallery imageMso="AppointmentColor5"idMso="CustomBibliographyGallery"label="Custom Bibliography CHANGE THIS LABEL"/>

                </

    menu>

    </

    box>

       </

    group>


    Thursday, January 30, 2014 2:53 AM
  • Thanks Janine

    The issue is defining the building blocks to the correct Gallery, by correct Category. Being able to filter by Category AND display Words preview which is a nice feature.

    Depending on the building block, to be defined to correct Gallery to insert correctly into the document.

    For example:

    Building block is a footer.

    Create BuildingBlock, Gallery set as ‘Custom Footer’

    Word recognises a ‘Custom Footer’ Gallery, and inserts into the document footers.

    If the building block footer is defined to a different gallery eg ‘CustomBibliographyGallery’

    The result is:

    The building block is inserted at the insertion point in the document.

    And not as expected in the documents footer.

    The impact of using the correct Gallery eg CustomTablesGallery the new building blocks now displays under Visual Tools

    See screen attachment.

    Which isn’t ideal, and best to have a separate area/menu.

    The Visual Tools Galleries may need updating to allow for greater flexibility for future work from other departments.

    I’ve used Gallery Custom 1-5 Galleries. This gives me the ‘Sub menu’ with a preview. However same issue occurs the footer building block is inserted at the insertion point, and not the correct behaviour of inserting into the documents footer.

    I’m thinking of the global design architecture to support requirements.

    Therefore what i need is a menu that displays

    Correct Category

    Correct Gallery and displays Words preview

    eg

    Department menu (Category)

    Custom Header (Gallery) with preview

    Custom Footer (Gallery)  with preview

    Custom Table (Gallery)    with preview

    Custom other (Gallery)    with preview

    Friday, January 31, 2014 5:27 AM
  • Hi dd

    <<If the building block footer is defined to a different gallery eg ‘CustomBibliographyGallery’

    The result is:

    The building block is inserted at the insertion point in the document.

    And not as expected in the documents footer.>>

    You should be able to use callbacks (onAction, getSelectedItemID, getSelectedItemIndex) in the Ribbon definitions for these galleries to run some code when a choice is made. This should let you insert a Footer, for example, in the correct StoryRange of the document.


    Cindy Meister, VSTO/Word MVP, my blog

    Friday, January 31, 2014 10:58 AM
    Moderator
  • Thanks Cindy

    Yes thats what I'll need to do.

    I was hoping to achieve a workable solution just using the xml ribbon utilising Words preview. However due to limitations Ill need to write code.

    Thanks again Cindy

    Sunday, February 2, 2014 9:58 PM