chetan Allipur

chetan Allipur

  • NA
  • 541
  • 167.6k

"getVisible" attribure not firing for second time in word.

Oct 10 2018 7:37 AM
getVisible" attribure not firing for second time in word VSTO.
Can anyone know the answer?
 
Below is my code
 
<group id="EDMSFlag" label="Re-Initialize as EDMS Shell" helperText="Update ARIDInitialize status to False" getVisible="IsCheckARIDInitializedFlag">
<primaryItem>
<button id="EDMSFlagBackStage" isDefinitive="true" label="Re-Initialize as EDMS Shell" getImage="homeimage" onAction="EDMSFlagSet"/>
</primaryItem>
</group>
 
public bool IsCheckARIDInitializedFlag(Office.IRibbonControl control)
{
bool IscheckMetadata = false;
Microsoft.Office.Interop.Word.Application app = Globals.ThisAddIn.Application;
if (app.Documents.Count > 0)
{
DocumentProperties oCustProps;
DocumentProperty oProp;
oCustProps = app.ActiveDocument.CustomDocumentProperties;
if (oCustProps.Count > 0)
{
foreach (DocumentProperty oProp_loopVariable in oCustProps)
{
oProp = oProp_loopVariable;
if (oProp.Name == "ARIDInitialized")
{
//IscheckMetadata = true;
string ARIDInitializedValue = oProp.Value;
if (ARIDInitializedValue.ToLower() == "true")
{
IscheckMetadata = true;
}
else if (ARIDInitializedValue.ToLower() == "false")
{
IscheckMetadata = false;
}
break;
}
}
if (IscheckMetadata == false)
{
return IscheckMetadata;
}
}
else
{
return IscheckMetadata;
}
}
else
{
return IscheckMetadata;
}
return IscheckMetadata;
}