private void btnReplaceContent_Click(object sender, EventArgs e) { Dictionary <string, string> dictSource = new Dictionary <string, string>(); dictSource.Add("TIS_HANDLE_NO", "T0001"); dictSource.Add("ACCUSE_INDUSTRY", "出租车"); dictSource.Add("ACCUSER_NAME", "张三"); string templateFile = Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "Templates/Advice.xls"); string savedFile = AsposeExcelTools.ExportWithReplace(templateFile, "testAdvice.xls", dictSource); if (!string.IsNullOrEmpty(savedFile)) { if (MessageDxUtil.ShowYesNoAndTips("导出成功,是否打开文件?") == System.Windows.Forms.DialogResult.Yes) { Process.Start(savedFile); } } }