【问题标题】:Convert template from MUSTACHE syntax to LINQ syntax将模板从 MUSTACHE 语法转换为 LINQ 语法
【发布时间】:2016-11-11 13:27:29
【问题描述】:

我正在用 C# + Aspose.Words 编写一个应用程序。是否可以将单词模板从 MUSTACHE 语法转换为 LINQ 语法?

【问题讨论】:

    标签: c# aspose aspose.words


    【解决方案1】:

    请使用以下代码示例来实现您的要求。希望这对您有所帮助。

    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 合作,担任开发人员传道者。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-06-15
      • 1970-01-01
      相关资源
      最近更新 更多