Hi,
Can you help me?
When I try to edit Word docx file with mailmerge field in header and a picture in the document body, function MailMerge.Execute throws an error "The type initializer for 'spr[]' threw an exception". Evertying works ok when the picture is not present.
What am I doing wrong?
My code is:
Spire.Doc.Document document = new Spire.Doc.Document();
document.LoadFromFile(dir + fileName);
string[] filedNames = new string[] { "mailmerge_tajnost" };
string fieldvalue = " ";
if (pd.OZNAKA_TAJNOSTI != null && pd.OZNAKA_TAJNOSTI >= 0)
fieldvalue = Misc.dicStepenTajnostiMaternji[(int)pd.OZNAKA_TAJNOSTI];
string[] filedValues = new string[] { fieldvalue };
document.MailMerge.Execute(filedNames, filedValues);
document.SaveToFile(dir + fileName, FileFormat.Docx);
Thank you,
Gordana