This project has moved. For the latest updates, please go here.

How to get a editBox value?

Jul 18, 2011 at 2:02 PM


          I have read the word COMAddinRibbonExample and add two editBoxes to RibbonUI.xml ,but i can not find any way to get a editBox value?

         Could you tell me how to get editBox's value?

          <?xml version="1.0" encoding="utf-8" ?>
<customUI xmlns="" >
      <tab id="myTab" label="C# RibbonAddin Example" >
        <group id="group1" label="Example">
          <button id="customButton1" label="Perference" imageMso="HappyFace" size="large" onAction="OnAction" />
          <button id="customButton2" label="About iFax" imageMso="HappyFace" size="large" onAction="OnAction" />
     <group id="group2" label="Example2">
          <editBox id="editBox1" label="Number1:"/>
          <editBox id="editBox2" label="Number2:"/>
         <button id="customButton3" label="" imageMso="HappyFace" size="large" onAction="Sum" />

Jul 18, 2011 at 4:35 PM

A little (bit more) about Ribbons

You see here as example:

<editBox id="EditBox1" getText="ThisDocument.MyTextMacro"
            label="My EditBox" onChange="ThisDocument.MyEditBoxMacro"/>

getText means a public function similar to OnAction in your addin looks as follows

public string GetText(IRibbonControl control)
    return control.Id;

Attribute Text maybe also supported to support text set without function call, i dont know.