document.Properties.FormFieldShading = false; does not work, I downloaded a Word document that still has form field shading. How can I resolve this issue? I am using FreeSpire.Doc in a .NET 6 project.
public byte[] DownFileWXPG(string ReportNO, string templdateName) {
WXPGFormat(ReportNO);
document = new Document(templdateName);
document.Properties.FormFieldShading = false;
SpireDocHelper.InsertTablemarkByText(document, 0, DicFuzhu1);
document.Properties.FormFieldShading = false;
using (MemoryStream memoryStream = new MemoryStream())
{
document.SaveToStream(memoryStream, FileFormat.Doc);
byte[] bytes = memoryStream.ToArray();
return bytes;
}
}
public static void InsertTablemarkByText(Document document, int SectionIndex, Dictionary<string, string> CanshuDic) { var sectionFuzhu = document.Sections[SectionIndex].Body.FormFields;
foreach (FormField field in sectionFuzhu)
{
try
{
field.OwnerParagraph.AppendText(CanshuDic[field.Name]);
}
catch { }
}
}