随笔分类 - c#&office
摘要:'合并excel的多个sheetSub 合并当前工作簿下的所有工作表()Application.ScreenUpdating = FalseFor j = 1 To Sheets.Count If Sheets(j).Name <> ActiveSheet.Name Then X = Range("
阅读全文
摘要:Aspose是一个很强大的控件,可以用来操作word,excel,ppt等文件,用这个控件来导入、导出数据非常方便。其中Aspose.Cells就是用来操作Excel的,功能有很多。我所用的是最基本的功能,读取Excel的数据并导入到Dataset或数据库中。读取Excel表格数据的代码如下:首先要
阅读全文
摘要:private void button3_Click(object sender, EventArgs e) { object savePathWord ="row.docx"; File.Copy("rowtemplate.docx", savePathWord.ToS...
阅读全文
摘要:rows.insert或rows.add前row必须有单元格cellprivate void button3_Click(object sender, EventArgs e) { object savePathWord ="row.docx"; File.Copy("ro...
阅读全文
摘要:http://www.aspose.com/docs/display/wordsnet/Aspose.Words.Tables.Row+ClassRetrieves the index of a row in a table.获得行索引[C#]int rowIndex = table.IndexO...
阅读全文
摘要:string json=value.Value; DataTable dt=Utils.JsonDataTableConvert.ToDataTable(json); string fileName = tableTempl...
阅读全文
摘要:辅助类1 json和datatable互转: 辅助类2 Excel表格数据和datatable互转: 书签内容替换封装: 调用: 效果: 打印 doc.Print(); 文本替换 doc.Range.Replace("{{name}}", "张三", false, true); 版权声明:本文为博主
阅读全文
摘要:由于NPOI暂时没找到书签内容替换功能,所以换用Apose.Word组件.using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;...
阅读全文
摘要:调用word的com组件将400条数据导入word表格中耗时10分钟简直不能忍受,使用NPOI组件耗时4秒钟.但是NPOI中替换书签内容的功能不知道是不支持还是没找到.辅助类 Excel表格数据与DataTable互转:using System;using System.Collections.Ge...
阅读全文
摘要:安装office2007,添加com引用Microsoft Word12.0 Object Library和Microsoft Office12.0 Object Libraryusing System;using System.Collections.Generic;using System.Li...
阅读全文

浙公网安备 33010602011771号