public string Mathequation1(Paragraph para = null)
{
string eqtxt = "";
if (para.Range.OMaths.Count > 0)
{
if (para.Range.InlineShapes.Count > 0)
{
InlineShape currentShape = para.Range.InlineShapes[1];
if (currentShape.Field.Code.Text.Trim().ToLower().Contains("equation"))
{
return "";
}
}
////equation handling convert to linearize
var DelimeterText = new StringBuilder();
List<string> eqtext = new List<string>();
int starti = 1;
string streq = "";
int eqcounter = 1;
Range r2 = para.Range;
foreach (OMath eq in r2.OMaths)
{
if (!para.Range.Text.Contains(eq.Range.Text))
{
return "";
}
eq.Linearize();
streq = eq.Range.Text ;
//streq = EquationParser(streq); //call equation parser
eqtext.Add(streq);
eq.Range.Text = "eq" + eqcounter;
eqcounter++;
eq.Remove();
}
//equation
eqtxt = r2.Text;
for (int i = 1; i < eqcounter; i++)
{
eqtxt = eqtxt.Replace("eq" + i, eqtext[i - 1]);
}
return eqtxt;
}}
How Can I Get the Equation in Docio