Using XML in VBA

From Ribbon Commander Documentation
Revision as of 23:57, 14 March 2013 by Rxdff15551 bb53 (Talk | contribs) (Serializing to XML)

Jump to: navigation, search

Introduction

Dynamic RibbonX controls are both

  • Serializable to XML
  • Instantiatable from XML

Serializing to XML

Public Sub SerializingButton()
 
    ' Create a new button
    Dim myButton As rxButton
    Set myButton = New rxButton
 
    ' Build up state
    With myButton
        .label = "My Button"
        .enabled = rxTrue
        .supertip = "My button supertip"
 
        ' Serialize to XML
        Debug.Print .XML
    End With
 
End Sub

The following xml code is printed out to the debug window:

<button supertip="My button supertip" enabled="true" label="My Button"></button>