When we MailMerge a field containing three #s in a row, the output contains four #s. (For example: ###-##-1234 will get output as ####-##-1234.) Test code to reproduce is pasted below.
Document doc=new Document(@"C:\TestStuff\\Templates\TestMasking.docx");
DataTable dataTable=new DataTable();
DataColumn dataColumn=new DataColumn("masktest") { DataType=Type.GetType("System.String") };
dataTable.Columns.Add(dataColumn);
DataRow dataRow=dataTable.NewRow();
dataRow["masktest"]="###-##-1234";
doc.MailMerge.Execute(dataRow);
const string testOutput=@"D:\TestStuff\Output\TestOutput.docx";
doc.Save(testOutput);
System.Diagnostics.Process.Start(testOutput);
Thanks,
-Dave