I have solved it my self.
Found another approach to do this as follows:
private void SetShapeBackColor(Shape objShape, System.Drawing.Color ShapeBackColor)
{
try
{
int iUndoScopeID;
byte R = ShapeBackColor.R;
byte G = ShapeBackColor.G;
byte B = ShapeBackColor.B;
#region Formation for the Master Shape
iUndoScopeID = LocationMapPage.Document.BeginUndoScope("Fill Color");
try { objShape.get_CellsSRC((short)VisSectionIndices.visSectionObject, (short)VisRowIndices.visRowFill, (short)VisCellIndices.visFillBkgnd).FormulaU = "THEMEGUARD(RGB(" + R + "," + G + "," + B + "))"; }
catch (Exception ex) { }
try { objShape.get_CellsSRC((short)VisSectionIndices.visSectionObject, (short)VisRowIndices.visRowFill, (short)VisCellIndices.visFillForegnd).FormulaU = "THEMEGUARD(RGB(" + R + "," + G + "," + B + "))"; }
catch (Exception ex) { }
LocationMapPage.Document.EndUndoScope(iUndoScopeID, true);
try { objShape.get_CellsSRC((short)VisSectionIndices.visSectionObject, (short)VisRowIndices.visRowLock, (short)VisCellIndices.visLockFormat).FormulaU = "1"; }
catch (Exception ex) { }
#endregion
foreach (Shape s in objShape.Shapes)
{
#region Formation for the Sub-Shapes in it.
iUndoScopeID = LocationMapPage.Document.BeginUndoScope("Fill Color");
try { s.get_CellsSRC((short)VisSectionIndices.visSectionObject, (short)VisRowIndices.visRowFill, (short)VisCellIndices.visFillBkgnd).FormulaU = "THEMEGUARD(RGB(" + R + "," + G + "," + B + "))"; }
catch (Exception ex) { }
try { s.get_CellsSRC((short)VisSectionIndices.visSectionObject, (short)VisRowIndices.visRowFill, (short)VisCellIndices.visFillForegnd).FormulaU = "THEMEGUARD(RGB(" + R + "," + G + "," + B + "))"; }
catch (Exception ex) { }
LocationMapPage.Document.EndUndoScope(iUndoScopeID, true);
try { s.get_CellsSRC((short)VisSectionIndices.visSectionObject, (short)VisRowIndices.visRowLock, (short)VisCellIndices.visLockFormat).FormulaU = "1"; }
catch (Exception ex) { }
#endregion
}
}
catch (Exception ex)
{
Common.WriteLog("Exception :" + ex);
}
}