title: Reading the public value of customdocumentproperties and making it selected in the ribbon
body: <p><a href="https://i.stack.imgur.com/sYyMS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sYyMS.png" alt="enter image description here" /></a>
  I can't read the value here when opening excel</p>
  <pre><code> DocumentProperties properties;
     
          
              var wb = Globals.ThisAddIn.Application.ActiveWorkbook;
            or  
              var wb = Globals.ThisAddIn.Application.ThisWorkbook;
              if (wb is null)
              {
                  return &quot;&quot;;
              }
              properties = ( DocumentProperties)wb.CustomDocumentProperties;
  
              foreach (DocumentProperty prop in properties)
              {
                  if (prop.Name == propertyName)
                  {
                      return prop.Value.ToString();
                  }
              }
  </code></pre>
  <p>ActiveWorkbook and ThisWorkbook are both null when opening excel.</p>
  <p>What I want to do is read the public value of the customdocumentproperties and make it selected in the ribbon.</p>
  <p><a href="https://i.stack.imgur.com/tKeQ0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tKeQ0.png" alt="enter image description here" /></a></p>