博客园  :: 首页  :: 新随笔  :: 联系 :: 管理

2008年9月21日

摘要: 1.c#操作word 在指定书签插入文字或者图片CodeCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->1usingWord=Microsoft.Office.Interop.Word;23objectNothing=System.Reflection.Missing.Value;4objectformat=Word.WdSaveFormat.wdFormatDocument;5Word.ApplicationwordApp=newWord. 阅读全文

posted @ 2008-09-21 10:52 codingsilence 阅读(165) 评论(0) 推荐(0)

摘要: 添加引用com中的miscrost word 11.0 objct librayusing System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;using Sy 阅读全文

posted @ 2008-09-21 10:48 codingsilence 阅读(427) 评论(0) 推荐(0)

摘要: 一.新建WORD模板 完全安装Word 2003 新建一个word,选中视图--工具栏--窗体,点击文字型窗体域添加一个域。双击新添加的域,默认文字填写你要显示的文字,域设置--书签填入一个标签名,用于在程序中识别这个域 二.添加COM引用---Microsoft Word 11.0 Object Library 三 .添加命名空间---using Microsoft.Office.Interop.Word;四.定义对象 ApplicationClass app = null;//定义应用程序对象 Document doc = null; //定义word文档对象 Object missing 阅读全文

posted @ 2008-09-21 09:34 codingsilence 阅读(5340) 评论(0) 推荐(1)

摘要: 要使用C#操作word,首先要添加引用: 1、添加引用->COM->Microsoft Word 11.0 Object Library2、在.cs文件中添加usingWord;下面的例子中包括C#对Word文档的创建、插入表格、设置样式等操作:(例子中代码有些涉及数据信息部分被省略,重要是介绍一些C#操作word文档的方法)publicstringCreateWordFile(stringCheckedInfo)...{stringmessage="";try...{ObjectNothing=System.Reflection.Missing.Value;D 阅读全文

posted @ 2008-09-21 09:31 codingsilence 阅读(842) 评论(0) 推荐(0)

摘要: usingSystem;usingSystem.Web;usingSystem.Text;usingSystem.Data;usingSystem.Web.UI;usingSystem.IO;usingSystem.Reflection;usingSystem.Collections;usingSystem.Runtime.InteropServices;usingMicrosoft.Office.Interop.Word;namespacetest{/**////<summary>///WordFile的摘要说明。///</summary>publicclassWor 阅读全文

posted @ 2008-09-21 09:28 codingsilence 阅读(395) 评论(0) 推荐(0)