A basic reader for custom toolbars is located in 

  sw/source/filter/ww8/ww8toolbar.[ch]xx ( http://svn.gnome.org/viewvc/ooo-build/trunk/patches/test/word-read-custom-toolbar-filter.diff )

There are many more records read than we use ( or know how to use ) unfortunately alot of the records here are dynamic length and to be able to skip them you need to read them, e.g.

Tcg255 ( containes 0..n instance of the following sub structures ) - no idea about any ( or if any ) order constraints

Tcg255\
       + CTBWrapper
       + PlfMcd
       + PlfAcd
       + PlfKme
       + TcgSttbf
       + MacroNames
 
I think we nearly have enough to do a simple import, e.g. create a new toolbar with the correct name and x controls that has associated macros. Handling built-in commands still is a little tricky [1] e.g. possible using TBCHeader.tcid ( but need to find the relevant id's )


The guts of what you need to know to read "Custom toobars" is located below.


Tcg255 record
  This record contains a sequence of structures that specify command-related customizations 

  Tcg255.CTBWrapper contains Customization records
    Customization contains the custom toolbar data
      Customization can contain CTB ( or TBDelta ) data
        TBDelta data contains modification to to standard toolbars ( currently we ignore all of that )
      Tcg255.Customization.CTB ( custom toolbar data, contains sub-records relating to the controls )
        Tcg255.Customization.CTB.TB ( toolbar data ) - 
        Tcg255.Customization.CTB.TBC array of records ( each record relates to a a control on the toolbar )
          Tcg255.Customization.CTB.TBC[n]
              Tcg255.Customization.CTB.TBC[n].TBCHeader 
                the header contains some useful info specifcally 
                   TBCHeader.tct - control type see table 1.
[1]                TBCHeader.tcid - control id - for built-in controls this can used identify the type of command ( maybe there is another way ) e.g. 0x14b is Switcher_Close_CloseAll ( ref. MS-CTDOC.pdf section 2.2 )
              Tcg255.Customization.CTB.TBC[n].TBCData ( exists except in the case of ActiveX controls ( e.g TBCHeader.tcid = 0x16 )
                Tcg255.Customization.CTB.TBC[n].TBCData.TBCGeneralInfo
                    basic info, tooltop, text to be shown for the toolbar control
                    ** additionally for a control with macro command TBCData.TBCGeneralInfo.TBCExtraInfo.wstrOnAction contains the macro name.
                Tcg255.Customization.CTB.TBC[n].TBCData.TBCSpecificInfo, this record exists depending on the control type ( from TBCHeader.tct )
                    TBCSpecificInfo.bFlags ( determine the option fields below )
                    TBCSpecificInfo.icon ( optional ) - how to process??
                    TBCSpecificInfo.iconMask ( optional )
                    TBCSpecificInfo.iBtnFace ( optional ) - Unsigned integer that specifies the icon of the toolbar control. When this value is set, the toolbar control will use the icon of the toolbar control whose toolbar control identifier (TCID) equals this value ( the problem is where do we get the set of toolbars from ) e.g. in the case of standard toolbars where are these stored ( or is it a hardcoded list ) - and it seems also this scenario arises when you use one of the inbuilt icons :-/

                    TBCSpecificInfo.wstrAcc ( optional )

Open things to find ( hopefully in the records we already read )
 o position of toolbar
 o size of toolbar
 o postition of controls in the toolbar
 o what to do with the icons ( need to find what we can use to read thos icons )
 

table 1.

 TBCHeader.tct                   controlSpecificInfo type

0x01 (Button control)              TBCBSpecific
0x10 (ExpandingGrid control)       TBCBSpecific
0x0A (Popup control)               TBCMenuSpecific
0x0C (ButtonPopup control)         TBCMenuSpecific
0x0D (SplitButtonPopup control)    TBCMenuSpecific
0x0E (SplitButtonMRUPopup control) TBCMenuSpecific
0x02 (Edit control)                TBCComboDropdow nSpecific
0x04 (ComboBox control)            TBCComboDropdow nSpecific
0x14 (GraphicCombo control)        TBCComboDropdow nSpecific
0x03 (DropDown control)            TBCComboDropdow nSpecific
0x06 (SplitDropDown control)       TBCComboDropdow nSpecific
0x09 (GraphicDropDown control)     TBCComboDropdow nSpecific
0x07 (OCXDropDown control)         controlSpecificInfo MUST NOT exist
0x0F (Label control)               controlSpecificInfo MUST NOT exist
0x12 (Grid control)                controlSpecificInfo MUST NOT exist
0x13 (Gauge control)               controlSpecificInfo MUST NOT exist
0x16 (ActiveX control)             controlSpecificInfo MUST NOT exist
