this is my first question on StackOverflow, so have patience :D
I'm actually trying to generate .docx files from .txt files throught Microsoft.Office.Interop.Word lib in Visual Studio Environment (I'm coding in C#).
Those Word files are meant to be exercices for children with specific help (colors, size, etc...).
Some of the txt files contains equations that I would like to recreate on Word with the specifi tool "OMath" (that, if I understood, will be used to create those "equation" boxes).
At that time, I didn't succeeded in generating more than 1 box at a time. For example, if a txt has 2 or more equations, all of them are created in the same equation box but not separately.
I have tried a code like that :
using Word = Microsoft.Office.Interop.Word;
...
Word.Application wapp = new Word.Application();
Word.Document wdoc = wapp.Documents.Add();
...
wpara = wdoc.Paragraphs.Add();
e.ElementAspect.setFormat(ref wpara); // set wpara format (color, font ...)
Word.Range test1 = wapp.Selection.Range;
test1.Text = e.Content;
test1 = wpara.Range.OMaths.Add(test1);
Word.OMath equation = test1.OMaths[1];
equation.BuildUp();