# Backstage (looking for a reference book)



## hatman (Jan 22, 2013)

In order to do hardcore ribbon building/manipulation, I use RibbonX by Martin, Puls and Hennig as my bible.  I was somewhat disappointed that they did not come out with a 2010 edition, though I can uderstand as the changes from 2007 to 2010 are not extensive.  However, the notable exception is the new Backstage object... anyone have advice on a good (read "exhaustively detailed") resource?


----------



## Andy Pope (Jan 25, 2013)

No aware of a book, but have you tried the MS resources in Fluent UI including backstage.
Office Fluent UI Developer Center | Backstage, Ribbon | MSDN


----------



## hatman (Jan 25, 2013)

Thanx Andy.  I JUST found this in the last hour or so, and it's a wealth of information... so far has filled in teh deatails I was lookign for.  Thnk you!!


----------



## Andrew Poulsom (Jan 25, 2013)

There's a good writeup on Backstage by Ron de Bruin here:

How do I change Backstage(File) view in Excel 2010


----------



## hatman (Jan 25, 2013)

Yes, Ron's article is excellent... probably the best one of it's type for a global view of things that can be changed and how to accomplish it. However, as with any article of that type, it's a starting point only. While I used it extensively, I also found that it really only hit the tip of the iceberg. I found this MSDN article expanded on several concepts and introduced several controls that Ron't article didn't touch upon.

At this point, I have pretty much completed the task that I set out to accomplish. In all o fthese artciles, there was really only one effect I couldn't figure out, and that is something that looks like a command button, but has (2) lines of text. Specifically, I am building a recently used file list for a dictator application that uses a custom file type. Building and managing teh list is pretty straight-forward, as well as the mechanics of making it work properly. But I wanted it to look more like what user's have come to expect of the native list. If you look closely, each file is presented on it's own button, with a "large" image, and (2) lines for the label. At this point in my research, I am assuming that this is a control object that is not exposed in the XML schema (it looks like a Task or a TaskGroup, but not quite). I have come up with an appearance that is acceptable to me, using the label property of a group object to present the filename, and then the label property of the button inside that group to present the full file/pathname.

For completeness, I'll post some short code snippets, in the event that someone has advice to improve it. Thanks for the advice and responses so far...

XML:

```
<tab id="BackStage_Tab"label="Recent Files">
<firstColumn> 
<group id="Group_1"getLabel="CallBack_Recent_File_Name"> 
<topItems> 
<layoutContainer id="layout1"layoutChildren="vertical">
<button id="Recent_1"
getLabel="CallBack_Recent_Label"
onAction="CallBack_Recent"
getVisible="CallBack_Recent_Visible"
imageMso="FileOpen" 
isDefinitive="true" />
</< font>layoutContainer> 
</< font>topItems> 
</< font>group> 
<group id="Group_3"getLabel="CallBack_Recent_File_Name"> 
<topItems> 
<layoutContainer id="layout3"layoutChildren="vertical">
<button id="Recent_3"
getLabel="CallBack_Recent_Label"
onAction="CallBack_Recent"
getVisible="CallBack_Recent_Visible"
imageMso="FileOpen" 
isDefinitive="true" />
</< font>layoutContainer> 
</< font>topItems> 
</< font>group> 
<group id="Group_2"getLabel="CallBack_Recent_File_Name"> 
<topItems> 
<layoutContainer id="layout2"layoutChildren="vertical">
<button id="Recent_2"
getLabel="CallBack_Recent_Label"
onAction="CallBack_Recent"
getVisible="CallBack_Recent_Visible"
imageMso="FileOpen" 
isDefinitive="true" />
</< font>layoutContainer> 
</< font>topItems> 
</< font>group> 
<group id="Group_4"getLabel="CallBack_Recent_File_Name"> 
<topItems> 
<layoutContainer id="layout4"layoutChildren="vertical">
<button id="Recent_4"
getLabel="CallBack_Recent_Label"
onAction="CallBack_Recent"
getVisible="CallBack_Recent_Visible"
imageMso="FileOpen" 
isDefinitive="true" />
</< font>layoutContainer> 
</< font>topItems> 
</< font>group> 
<group id="Group_5"getLabel="CallBack_Recent_File_Name"> 
<topItems> 
<layoutContainer id="layout5"layoutChildren="vertical">
<button id="Recent_5"
getLabel="CallBack_Recent_Label"
onAction="CallBack_Recent"
getVisible="CallBack_Recent_Visible"
imageMso="FileOpen" 
isDefinitive="true" />
</< font>layoutContainer> 
</< font>topItems> 
</< font>group> 
<group id="Group_6"getLabel="CallBack_Recent_File_Name"> 
<topItems> 
<layoutContainer id="layout6"layoutChildren="vertical">
<button id="Recent_6"
getLabel="CallBack_Recent_Label"
onAction="CallBack_Recent"
getVisible="CallBack_Recent_Visible"
imageMso="FileOpen" 
isDefinitive="true" />
</< font>layoutContainer> 
</< font>topItems> 
</< font>group> 
　
<group id="Group_7"getLabel="CallBack_Recent_File_Name"> 
<topItems> 
<layoutContainer id="layout7"layoutChildren="vertical">
<button id="Recent_7"
getLabel="CallBack_Recent_Label"
onAction="CallBack_Recent"
getVisible="CallBack_Recent_Visible"
imageMso="FileOpen" 
isDefinitive="true" />
</< font>layoutContainer> 
</< font>topItems> 
</< font>group> 
<group id="Group_8"getLabel="CallBack_Recent_File_Name"> 
<topItems> 
<layoutContainer id="layout8"layoutChildren="vertical">
<button id="Recent_8"
getLabel="CallBack_Recent_Label"
onAction="CallBack_Recent"
getVisible="CallBack_Recent_Visible"
imageMso="FileOpen" 
isDefinitive="true" />
</< font>layoutContainer> 
</< font>topItems> 
</< font>group> 
<group id="Group_9"getLabel="CallBack_Recent_File_Name"> 
<topItems> 
<layoutContainer id="layout9"layoutChildren="vertical">
<button id="Recent_9"
getLabel="CallBack_Recent_Label"
onAction="CallBack_Recent"
getVisible="CallBack_Recent_Visible"
imageMso="FileOpen" 
isDefinitive="true" />
</< font>layoutContainer> 
</< font>topItems> 
</< font>group> 
　
</< font>firstColumn> 
</< font>tab> 
</< font>backstage>
```

And Cal
lbacks for the Labels and Visibility:

```
'Callback for getLabel
Sub CallBack_Recent_File_Name(control As IRibbonControl, ByRef returnedVal)
    
    Dim Recent_File_Name As String
    Dim Recent_File_Path_Name As String
    Dim slash_place As Integer
    
    Recent_File_Path_Name = GetSetting(App_Name, Sect_1, Right(control.ID, Len(control.ID) - Len("Group_")), "")
    
    slash_place = InStrRev(Recent_File_Path_Name, "\")
    
    Recent_File_Name = Right(Recent_File_Path_Name, Len(Recent_File_Path_Name) - slash_place)
    
    returnedVal = Recent_File_Name
End Sub
'Callback for  getLabel
Sub CallBack_Recent_Label(control As IRibbonControl, ByRef returnedVal)
   Dim Recent_File_Name
    
    Recent_File_Name = GetSetting(App_Name, Sect_1, Right(control.ID, Len(control.ID) - Len(Recent_File_Base_Text)), "")
    
    returnedVal = Recent_File_Name
End Sub
'Callback for getVisible
Sub CallBack_Recent_Visible(control As IRibbonControl, ByRef returnedVal)
   Dim Recent_File_Name
    
    Recent_File_Name = GetSetting(App_Name, Sect_1, Right(control.ID, Len(control.ID) - Len(Recent_File_Base_Text)), "")
    
    If Recent_File_Name = "" Then
    
        returnedVal = False
        
    Else
    
        returnedVal = True
        
    End If
    
End Sub
```


----------



## Andrew Poulsom (Jan 25, 2013)

It looks like a task with a label (first line) and a description (second line).


----------



## hatman (Jan 25, 2013)

That was also my assessment, however, from what I can see, a Task doesn't have an onAction property... it's a container for other stuff... unless I am missing something?


----------

