当前位置: 首页>>代码示例>>C#>>正文


C# DocX.SaveAs方法代码示例

本文整理汇总了C#中Novacode.DocX.SaveAs方法的典型用法代码示例。如果您正苦于以下问题:C# DocX.SaveAs方法的具体用法?C# DocX.SaveAs怎么用?C# DocX.SaveAs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Novacode.DocX的用法示例。


在下文中一共展示了DocX.SaveAs方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TemplBuilder

 /// <summary>
 /// Start with filename
 /// </summary>
 /// <param name="filename"></param>
 /// <param name="defaultModules"></param>
 public TemplBuilder(string filename, bool defaultModules = true)
     : this(defaultModules)
 {
     Doc = DocX.Load(filename);
     Doc.SaveAs(Stream);
     Filename = filename;
 }
开发者ID:ichpuchtli,项目名称:templ-dot-net,代码行数:12,代码来源:Builder.cs

示例2: Main

        static void Main(string[] args)
        {
            // Store a global reference to the executing assembly.
            g_assembly = Assembly.GetExecutingAssembly();

            // Try to load the template 'InvoiceTemplate.docx'.
            try
            {
                // Store a global reference to the loaded document.
                g_document = DocX.Load(@"Content/letterheadpad_template.docx");

                /*
                 * The template 'InvoiceTemplate.docx' exists,
                 * so lets use it to create an invoice for a factitious company
                 * called "The Happy Builder" and store a global reference it.
                 */
                g_document = CreateInvoiceFromTemplate(DocX.Load(@"Content/letterheadpad_template.docx"));

                // Save all changes made to this template as Invoice_The_Happy_Builder.docx (We don't want to replace InvoiceTemplate.docx).
                g_document.SaveAs("Report_print.docx");
            }

            // The template 'InvoiceTemplate.docx' does not exist, so create it.
            catch (FileNotFoundException)
            {
                // Create a store a global reference to the template 'InvoiceTemplate.docx'.
                Console.WriteLine("FILE NOT FOUNDDDDDDDDDDDDDDDDDDDDDDDD");

            }
        }
开发者ID:pucit,项目名称:SchoolAutomationSource,代码行数:30,代码来源:print.cs

示例3: SaveDoc

 private void SaveDoc(DocX doc, string dir, string fileName)
 {
     doc.SaveAs(dir + fileName);
 }
开发者ID:mkoscak,项目名称:easy-replacer,代码行数:4,代码来源:FrmMain.cs

示例4: TemplDoc

 /// <summary>
 /// New document from filename
 /// </summary>
 /// <param name="filename"></param>
 public TemplDoc(string filename)
 {
     Filename = filename;
     Docx = DocX.Load(Filename);
     Docx.SaveAs(Stream);
 }
开发者ID:CPonty,项目名称:templ-dot-net,代码行数:10,代码来源:Document.cs


注:本文中的Novacode.DocX.SaveAs方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。