-2
我正在C#+ Aspose.Words上编写应用程序。是否有可能将Word模板从MUSTACHE语法转换为LINQ语法?将模板从MUSTACHE语法转换为LINQ语法
我正在C#+ Aspose.Words上编写应用程序。是否有可能将Word模板从MUSTACHE语法转换为LINQ语法?将模板从MUSTACHE语法转换为LINQ语法
请使用下面的代码示例来实现您的要求。希望这可以帮助你。
FindReplaceOptions options = new FindReplaceOptions();
Document doc = new Document(MyDir + "in.docx");
doc.MailMerge.UseNonMergeFields = true;
foreach (String item in doc.MailMerge.GetFieldNames())
{
doc.Range.Replace("{{ " + item + " }}", "<<["+ item + "]>>", options);
}
doc.Save(MyDir + "Out.docx");
我使用Aspose作为Developer evangelist。