解决方案 »
- 100分求在gridview中单击弹出菜单修改和删除本行的代码
- 手动配置ASP.NET2.0
- 一个小问题
- 有没有办法知道访问自己网站的用户是哪个地方的
- vs2005中一切正常,iis中无法写入删除数据,什么原因??
- 电子ePass1000钥匙如何制作做?
- 使用jmail时发生:异常详细信息: System.Runtime.InteropServices.COMException: DLL 中出错!
- 放在共享类中的异常大家怎么处理?
- 问个简单的问题!希望有人能帮助!
- <asp:linkbutton runat ="server">网关</asp:linkbutton>
- 各位大神 请问 连接oracle 时 为什么winform 和plsql都可以成功连接 就是asp.net连接不上
- 已知类型的前提下,怎么去生成实例
newTable.Borders.OutsideLineStyle = Microsoft.Office.Interop.Word.WdLineStyle.wdLineStyleSingle;
newTable.Borders.InsideLineStyle = Microsoft.Office.Interop.Word.WdLineStyle.wdLineStyleSingle; newTable.Columns[1].Width = 175f;
newTable.Columns[2].Width = 205f; //第1行
newTable.Cell(1, 1).Application.Selection.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphCenter;
newTable.Cell(1, 2).Application.Selection.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphCenter;
newTable.Cell(1, 1).Range.Text = "项 目";
newTable.Cell(1, 2).Range.Text = "终期建设规模";
//文档中创建表格
if (rad_zl35.Checked)
{
//第2行
newTable.Cell(2, 1).Application.Selection.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphCenter;
newTable.Cell(2, 2).Application.Selection.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphCenter;
newTable.Cell(2, 1).Range.Text = "双卷边单分支";
newTable.Cell(2, 2).Range.Text = CommonHelper.GetNum(txt_sjbdfz_35kv.Text).ToString(); //第3行
newTable.Cell(3, 1).Application.Selection.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphCenter;
newTable.Cell(3, 2).Application.Selection.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphCenter;
newTable.Cell(3, 1).Range.Text = "35kV线路";
newTable.Cell(3, 2).Range.Text = CommonHelper.GetNum(txt_35kvxl_35kv.Text).ToString(); //第4行
newTable.Cell(4, 1).Application.Selection.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphCenter;
newTable.Cell(4, 2).Application.Selection.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphCenter;
newTable.Cell(4, 1).Range.Text = "35kV分段";
newTable.Cell(4, 2).Range.Text = CommonHelper.GetNum(txt_35kvfd_35kv.Text).ToString(); //第5行
newTable.Cell(5, 1).Application.Selection.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphCenter;
newTable.Cell(5, 2).Application.Selection.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphCenter;
newTable.Cell(5, 1).Range.Text = "10kV线路";
newTable.Cell(5, 2).Range.Text = CommonHelper.GetNum(txt_10kvxl_35kv.Text).ToString(); //第6行
newTable.Cell(6, 1).Application.Selection.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphCenter;
newTable.Cell(6, 2).Application.Selection.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphCenter;
newTable.Cell(6, 1).Range.Text = "10kV分段";
newTable.Cell(6, 2).Range.Text = CommonHelper.GetNum(txt_10kvfd_35kv.Text).ToString(); //第7行
newTable.Cell(7, 1).Application.Selection.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphCenter;
newTable.Cell(7, 2).Application.Selection.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphCenter;
newTable.Cell(7, 1).Range.Text = "10kV电容器";
newTable.Cell(7, 2).Range.Text = CommonHelper.GetNum(txt_10kvdrq_35kv.Text).ToString(); //第8行
newTable.Cell(8, 1).Application.Selection.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphCenter;
newTable.Cell(8, 2).Application.Selection.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphCenter;
newTable.Cell(8, 1).Range.Text = "接地变";
newTable.Cell(8, 2).Range.Text = CommonHelper.GetNum(txt_jdb_35kv.Text).ToString(); //第9行
newTable.Cell(9, 1).Application.Selection.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphCenter;
newTable.Cell(9, 2).Application.Selection.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphCenter;
newTable.Cell(9, 1).Range.Text = "站用变";
newTable.Cell(9, 2).Range.Text = CommonHelper.GetNum(txt_zyb_35kv.Text).ToString();
}
这个是我已经实现过了的部分代码,你可以拿来参考一下
WordDoc.Application.ActiveDocument.InlineShapes.AddPicture(FileName, ref LinkToFile, ref SaveWithDocument, ref Anchor);