教教我怎样使用Word模板
Office2003的是.xlsWord 2007支持格式:Word Document (.docx) - 默认格式Word Macro-enabled Document (.docm)Word Template (.dotx)Word Macro-enabled Document Template (.dotm)Excel 2007支持文件格式:Excel Workbook (.xlsx) - 默认格式Excel Macro-enabled Workbook (.xlsm)Excel Template (.xltx)Excel Macro-enabled Workbook Template (.xltm)Excel Binary Workbook (.xlsb)Excel Add-in (.xlam)PowerPoint 2007支持格式:PowerPoint Presentation (.pptx) - 默认格式PowerPoint Macro-enabled Presentation (.pptm)PowerPoint Slide Show (.ppsx)PowerPoint Macro-enabled Slide Show (.ppsx)PowerPoint Template (.potx)PowerPoint Macro-enabled Presentation Template (.potm)PowerPoint Add-in (.ppam)并非所有格式均向下兼容,仅有以下格式将兼容Office 2000:Word Document (.docx)Word Macro-enabled Document (.docm)Excel Workbook (.xlsx)Excel Macro-enabled Workbook (.xlsm)Excel Template (.xltx)Excel Macro-enabled Template (.xltm)Excel binary Workbook (.xlsb)Excel Add-in (.xlam)PowerPoint Presentation (.pptx)PowerPoint Macro-enabled Presentation (.pptm)PowerPoint Slide Show (.ppsx)PowerPoint Macro-enabled Slide Show (.ppsm)PowerPoint Template (.potx)PowerPoint Macro-enabled Presentation Template (.potm)除此之外,Office 2007还将支持PDF格式以及XPS格式够全了吧'!!!
ASP.NET(C#):如何利用word模板dot文件生成报表。
ASP.NET利用dot模板生成Word文档代码,假定有一个模板文件位于网站Mywebsite/templates/a.dot,现在需要利用Word.ApplicationClass和Word.Document类来生成一个word文档。
关键代码如下: //初始化生成word文档需要的信息 Word.Application appWord =null; Word.Document doc = null; try { appWord = new Word.ApplicationClass(); appWord.Visible = false; object objTrue = true; object objFalse = false; object objTemplate = Server.MapPath(@"templates\a.dot");//模板路径 object objDocType = Word.WdDocumentType.wdTypeDocument; doc = appWord.Documents.Add(ref objTemplate, ref objFalse, ref objDocType, ref objTrue); //第一步生成word文档 //定义书签变量 object obDD_Name = "DD_Name";//姓 名 object obDD_Sex = "DD_Sex";//性 别 object obDD_Age = "DD_Age";//年龄 object obDD_Birthday = "DD_Birthday"; //出生年月 object obDD_Nation = "DD_Nation"; //民 族 object obDD_Native = "DD_Native"; //籍 贯 //第二步 读取数据,填充数据集 SqlDataReader dr = XXXXX;//读取出来的数据集 //第三步 给书签赋值 //给书签赋值 doc.Bookmarks.get_Item(ref obDD_Name).Range.Text = dr["appliername"].ToString(); //姓 名 doc.Bookmarks.get_Item(ref obDD_Sex).Range.Text = getCodeFullNameStd("性别", dr["Sex"].ToString());//性 别 doc.Bookmarks.get_Item(ref obDD_Age).Range.Text = Convert.ToString(DateTime.Now.Year - ((DateTime)dr["Birthday"]).Year);//年龄 . //第四步 生成word object filename = Server.MapPath("file") + "\\" + "XXXXXXXXXX情况表" +".doc"; object miss = System.Reflection.Missing.Value; doc.SaveAs(ref filename, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss); object missingValue = Type.Missing; object doNotSaveChanges = Word.WdSaveOptions.wdDoNotSaveChanges; doc.Close(ref doNotSaveChanges, ref missingValue, ref missingValue); appWord.Application.Quit(ref miss, ref miss, ref miss); doc = null; appWord = null; } catch (System.Exception e) { //捕捉异常,如果出现异常则清空实例,退出word,同时释放资源 string aa = e.ToString(); object miss = System.Reflection.Missing.Value; object missingValue = Type.Missing; object doNotSaveChanges = Word.WdSaveOptions.wdDoNotSaveChanges; doc.Close(ref doNotSaveChanges, ref missingValue, ref missingValue); appWord.Application.Quit(ref miss, ref miss, ref miss); doc = null; appWord = null; }
怎么样使多个不同WORD模板文档放在一个word文档中?
问:怎么使原来的word文档共用一个模板?比如我先前的文档设置的是3号字体,现在改用五号了,而现在使用的模板加上了网格线,这样的情况下我想一次把电脑上的文档全部改成现在模板的样式,应该怎样弄呀!回答:设置完成后-另存为:模板格式。
用Word 编排文档时,用户时时刻刻都在使用模板,模板是一类特殊的文档,它可以提供完成最终文档所需要的基本工具。
使用模板可以快速生成所需要文档的大致框架。
在Word 中,每一个文档都是在模板的基础上建立的。
Word 默认使用的模板是 Normal 模板。
模板中包含以下元素: 每个文档中的文字和图形,例如,页眉和页脚;插入日期、时间和文件名、文档标题等信息的域;占位符;公司徽标。
用【文件】菜单中的【页面设置】命令设置页边距和其他页面版式选项。
样式。
宏项目项。
保存为自动图文集词条的文字和图形。
自定义工具栏、菜单和快捷键。
1.4.1 使用Word 中的模板创建新文档 Word 提供了许多常见文档类型的模板,如备忘录、报告、传真、商务信件、简历等。
可以使用这些模板来快速地创建文档。
下面以创建中文典雅型信函为例,说明如何使用模板来创建文档。
(1)选择【文件】菜单中的【新建】命令,出现【新建】对话框,如图1-16 所示。
在Word 中,将模板按照不同的种类分别放在相应的标签中。
例如有关备忘录方面的模板,存放在【备忘录】标签中;有关信函和传真方面的模板,存放在【信函和传真】标签中;有关Web 页方面的模板,存放在【Web 页】标签中。
(2)选中【信函与传真】选项卡,再单击选择【中文典雅型信函】图标。
此时,在右面的【预览】框中将显示该信函模板的示意图。
(3)单击【确定】按钮,即可创建一份信函,效果如图1-17 所示。
可单击占位符的位置,然后键入所需的文本。
例如,单击【单击此处键入收信人姓名】以将其位置选定,再键入收信人的姓名。
1.4.2 创建模板 虽然Word 自带了不少模板,但用户仍然可能找不到合适的模板,或者想把自己常用的格式保存起来,这时可以创建新模板。
1.4.2.1 创建基于已有文档的模板 以现有的文档文件为模板,可以快捷地创建一个新模板,供以后编辑类似文档时使用。
方法如下: (1)单击【文件】菜单中的【打开】菜单项,从文档列表框中选中所需文档,单击【确定】按钮打开它。
(2)单击【文件】菜单中的【另存为】命令,弹出【另存为】对话窗口。
(3)单击【保存类型】列表框,在弹出的文件类型列表中选中【文档模板】。
(4)在【文件名】编辑框中输入新模板的名称。
(5)从【保存位置】列表框中打开MSOffice(或Word)文件夹中的 Template 文件夹,选定保存模板的文件夹,所选定的文件夹将决定在选择【文件】菜单的【新建】命令时,模板所在的标签位置。
(6)单击【确定】按钮保存模板。
1.4.2.2 创建基于现存模板的模板 如果系统中已经有类似的模板,执行下面的步骤,可以加快创建模板的进程。
(1)单击【文件】菜单中的【新建】命令,弹出新建对话窗口。
(2)选中与要创建的模板类似的模板,如果要从一个空白模板和默认设置开始,就选中【空文档】。
(3)选中【新建】组框中的【模板】互斥项。
(4)单击【确定】按钮,创建新模板。
(5)添加该模板创建的所有新文档中都需要的文字和图形。
(6)修改页边距设置、纸张大小和打印方向、样式和其他格式。
(7)设置页眉和页脚的格式。
(8)创建、修改、复制模板需要的自动图文集词条、宏命令、工具栏、快捷键等。
(9)同前面一样保存模板。
1.4.3 修改模板 可以修改已有的模板。
使其包含自动图文集词条、宏、工具栏、菜单和快捷键等。
模板被修改之后,模板文本、样式、节格式的修改对以前基于该模板创建的文档没有影响;而在模板中所进行创建或修改对基于这个修改后模板创建的所有文档都有效。
修改模板的步骤如下: (1)单击【文件】菜单中的【打开】命令,或者单击【常用】工具栏上的【打开】按钮,出现【打开】对话框。
(2)单击【文件类型】列表框,在弹出的列表框中选中【文档模板】选项。
(3)找到存放模板的文件夹,在【名称】列表框中选中欲修改的模板名称,单击【确定】按钮,打开模板。
(4)对打开的模板进行修改,如对模板中的文字和图形进行编辑和格式化,设置页面和文本格式,创建或修改样式,修改快捷键、工具栏或菜单,定义自动图文集词条,创建宏命令,或者复制、重命名或删除模板上的各种项目等。
(5)修改完毕,单击【文件】菜单中的【保存】命令,或者单击【常用】工具栏的【保存】按钮,保存模板。
实际上,修改模板和修改文档没有什么两样,不同的是,修改文档主要是修改文档中的文本和图形等内容,而修改模板主要是修改模板所包含的样式、自动图文集、宏命令、页面格式、节格式、工具栏、菜单、快捷键等内容。
1.4.4 改变文档的模板 有时用一个模板创建文档并编辑一部分内容后,却发现另一个模板中的样式、宏、自动图文集更适合这个文档,可以改变与文档连接的模板。
也可以添加共用的模板,或者将另一个文档或模板的条目复制到该文档中。
1.4.4.1 改变与文档相连接的模板 改变与文档相连接的模板后,可以使...
怎么制作word复杂模板?感激不尽
第1步,打开Word文档窗口,切换到“页面布局”功能区。
在“页面设置”分组中,单击显示“页面设置”对话框按钮。
第2步,打开“页面设置”对话框,切换到“页边距”选项卡。
在“页码范围”区域单击“多页”下拉三角按钮,并在打开的下拉菜单中选择“书籍折页”选项,如图所示。
第3步,切换到“纸张”选项卡,单击“纸张大小”下拉三角按钮,并在打开的下拉菜单中选择合适的纸张类型。
由于使用“书籍折页”页面设置后,纸张方向只能选择“横向”,因此用户应当选择2倍于书籍幅面的纸张类型。
例如,如果书籍是A4幅面,则应该选择A3纸张;如果书籍是B5负面,则应该选择B4幅面。
完成纸张大小的设置后单击“确定”按钮,如图所示。
第4步,返回Word2007文档窗口,单击office按钮。
在Office菜单中指向“打印”选项,并在打开的下一级菜单中单击“打印”命令。
第5步,打开“打印”对话框,选中“手动双面打印”复选框以便更好地控制纸张的正、反面放置。
然后单击“确定”按钮开始打印。
完成第一张的打印后,需要将该纸张反面放入打印机以打印反面(可能需要多次尝试才能确定的放置方向),如图所示。
怎样在WORD文档里制作文件模板
操作步骤:1、在Word中新建一个空白文档;2、根据需要进入设置;3、单击窗口左上角的office按钮,在弹出的下拉菜单中选择保存;4、弹出另存为对话框,在保存位置C盘的Documents and Settings\Administrator\ApplicationData\Microsoft\Templates处,在保存类型处选择Word模板,在文件名处输入一个名称,如:自定义模板;5、使用时单击窗口左上角的office按钮,在弹出的下拉菜单中选择新建;6、弹出新建文档对话框,选择我的模板;7、弹出新建对话框,选择上面设置的自定义模板即可,如图所示。
如何在C#中使用OpenXml操作Word模版,向Bookmark中填充数据。
对word的操作给你这个是把word打开 并把其内容 复制出来 你参考一下吧 //btnFindFile_Click(object sender, EventArgs e)中应该按照路径找章节编码,暂时没有实现; private Microsoft.Office.Interop.Word.ApplicationClass oWordApplic; private Microsoft.Office.Interop.Word.Document oDoc; object missing = System.Reflection.Missing.Value; private List SQlStrList = new List(); private ArrayList arr = new ArrayList(); private string ZJBM = ""; private int C = 0; public frm导入Word() { InitializeComponent(); } public class objclass { public string _value; public string _text; public override string ToString() { return _text; } public objclass(string v, string t) { _text = t; _value = v; } public override bool Equals(object obj) { return obj.ToString() == this._value; } } private void frmKZQKDR_Load(object sender, EventArgs e) { this.cmbTX.SelectedIndex = 0; 基础类.buildTree.Bound难易程度(cmbNYCD); cmbNYCD.SelectedIndex = -1; 基础类.buildTree.Bound题目类型(cmbTX); } private void btnFindFile_Click(object sender, EventArgs e)//将word内容导入到RichTextBox中 { openFileDialog1.Filter = "(*.doc)|*.doc"; if (openFileDialog1.ShowDialog(this) == DialogResult.OK) { txtExcelFile.Text = openFileDialog1.FileName; //打开word,拷贝内容至RTF WordHelp(); Open(txtExcelFile.Text); oWordApplic.Selection.WholeStory(); oWordApplic.Selection.Copy(); richTextBox1.Clear(); richTextBox1.Paste(); Clipboard.Clear(); //避免弹出normal.dot被使用的对话框 oWordApplic.NormalTemplate.Saved = true; oDoc.Close(ref missing, ref missing, ref missing); Quit(); start = 0; //从得到的路径获得当前章节编码(尚未实现) ZJBM = ""; } } #region///word用函数 public Microsoft.Office.Interop.Word.ApplicationClass WordApplication { get { return oWordApplic; } } public void WordHelp() { // activate the interface with the COM object of Microsoft Word oWordApplic = new Microsoft.Office.Interop.Word.ApplicationClass(); } public void WordHelp(Microsoft.Office.Interop.Word.ApplicationClass wordapp) { oWordApplic = wordapp; } // Open a file (the file must exists) and activate it public void Open(string strFileName) { object fileName = strFileName; object readOnly = false; object isVisible = true; oDoc = oWordApplic.Documents.Open(ref fileName, ref missing, ref readOnly, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref isVisible, ref missing, ref missing, ref missing, ref missing); oDoc.Activate(); } // Open a new document public void Open() { oDoc = oWordApplic.Documents.Add(ref missing, ref missing, ref missing, ref missing); oDoc.Activate(); } public void Quit() { oWordApplic.Application.Quit(ref missing, ref missing, ref missing); } /// 打开Word文档,并且返回对象oDoc /// 完整Word文件路径+名称 /// 返回的Word.Document oDoc对象 public Microsoft.Office.Interop.Word.Document CreateWordDocument(string FileName, bool HideWin) { if (FileName == "") return null; oWordApplic.Visible = HideWin; oWordApplic.Caption = ""; oWordApplic.Options.CheckSpellingAsYouType = false; oWordApplic.Options.CheckGrammarAsYouType = false; Object filename = FileName; Object ConfirmConversions = false; Object ReadOnly = false; Object AddToRecentFiles = false; Object PasswordDocument = System.Type.Missing; Object PasswordTemplate = System.Type.Missing; Object Revert = System.Type.Missing; Object WritePasswordDocument = System.Type.Missing; Object WritePasswordTemplate = System.Type.Missing; Object Format = System.Type.Missing; Object Encoding = System.Type.Missing; Object Visible = System.Type.Missing; Object OpenAndRepair = System.Type.Missing; Object DocumentDirection = System.Type.Missing; Object NoEncodingDialog = System.Type.Missing; Object XMLTransform = System.Type.Missing; try { Microsoft.Office.Interop.Word.Document wordDoc = oWordApplic.Documents.Open(ref filename, ref ConfirmConversions, ref ReadOnly, ref AddToRecentFiles, ref PasswordDocument, ref PasswordTemplate, ref Revert, ref WritePasswordDocument, ref WritePasswordTemplate, ref Format, ref Encoding, ref Visible, ref OpenAndRepair, ref DocumentDirection, ref NoEncodingDialog, ref XMLTransform); return wordDoc; } catch (Exception ex) { MessageBox.Show(ex.Message); return null; } } public void SaveAs(Microsoft.Office.Interop.Word.Document oDoc, string strFileName) { object fileName = strFileName; if (File.Exists(strFileName)) { if (MessageBox.Show("文件'" + strFileName + "'已经存在,选确定覆盖原文件,选取消退出操作!", "警告", MessageBoxButtons.O...
java word中表格如何排版输出
首先我用的技术是 poi 这是代码,一个工具类得调用public class WordUtil { /** * 基于模板文件导出 word 文档,此方法主要是用来处理文档中需要替换的文本内容,对图片和表格无效 * * @param templatePath * 模板文件的路径,要求路径中要包含全名,并且模板文件只能是 07 及以上格式,即 docx 的文件 * @param destFilePath * 导出文件的存放路径,包含文件名,例如,E:/test/小区公告.docx * @param data * 用来替换文档中预定义的字符串,要求预定义的字符串与 data 中的 key 值要相同 */ public static void exportWordByTemplate(String templatePath, String destFilePath, Map data) { FileOutputStream out = null; XWPFDocument doc = null; try { doc = new XWPFDocument(POIXMLDocument.openPackage(templatePath)); List listRun; List listParagraphs = doc.getParagraphs(); for (int i = 0; i data) { try { WordExtractor doc = new WordExtractor(new FileInputStream( templatePath)); String content = doc.getText(); for (String key : data.keySet()) { content = content.replaceAll(key, data.get(key)); } byte b[] = content.getBytes(); ByteArrayInputStream bais = new ByteArrayInputStream(b); POIFSFileSystem fs = new POIFSFileSystem(); DirectoryEntry directory = fs.getRoot(); directory.createDocument("WordDocument", bais); FileOutputStream ostream = new FileOutputStream(destFilePath); fs.writeFilesystem(ostream); bais.close(); ostream.close(); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } public static void main(String[] args) throws Exception { Map maps = new HashMap(); maps.put("appellation", "万达公寓业主:"); maps.put( "main_body", "输出的内容"); maps.put("date", "2013年1月23日"); exportWordByTemplate("E:/sss 2.docx", "E:/test/test.doc", maps);}}"E:/sss 2.docx 模板存放的地址。
E:/test/test.doc 新生成的地址。
用Microsoft Word 怎么打拼音的四线三格及小学写字的"田"字框!!...
wps:米字格模板http://template://template.wps.kingsoft.microsoft.net/info/11229-1.htm金山模板(也可用与Word)http://www.yangdong://news.onlinedown.htm" target="_blank">http.onlinedown.net/info/11229-1.aspx" target="_blank">http://office.name/New_muban/word-mzgz.dot微软教学模板 五更信 | 发布于2005-11-06 16:42 评论
java word中表格如何排版输出
首先我用的技术是 poi 这是代码,一个工具类得调用public class WordUtil { /** * 基于模板文件导出 word 文档,此方法主要是用来处理文档中需要替换的文本内容,对图片和表格无效 * * @param templatePath * 模板文件的路径,要求路径中要包含全名,并且模板文件只能是 07 及以上格式,即 docx 的文件 * @param destFilePath * 导出文件的存放路径,包含文件名,例如,E:/test/小区公告.docx * @param data * 用来替换文档中预定义的字符串,要求预定义的字符串与 data 中的 key 值要相同 */ public static void exportWordByTemplate(String templatePath, String destFilePath, Map data) { FileOutputStream out = null; XWPFDocument doc = null; try { doc = new XWPFDocument(POIXMLDocument.openPackage(templatePath)); List listRun; List listParagraphs = doc.getParagraphs(); for (int i = 0; i < listParagraphs.size(); i++) { listRun = listParagraphs.get(i).getRuns(); for (int j = 0; j < listRun.size(); j++) { if (data.get(listRun.get(j).getText(0)) != null) { String val = data.get(listRun.get(j).getText(0)); listRun.get(j).setText(val, 0); } } } File destFile = new File(destFilePath); if (!destFile.getParentFile().exists()) { destFile.getParentFile().mkdirs(); } out = new FileOutputStream(destFilePath); doc.write(out); } catch (IOException e) { e.printStackTrace(); } finally { try { if (out != null) out.close(); } catch (IOException e) { e.printStackTrace(); } } } /** * 基于模板文件导出 word 文档,该方法支持03格式,但是此方法只能保留文档内容,不能保留文档中的样式和图片,建议将模板使用 07 的格式保存 * * @param templatePath * 模板文件的路径 * @param destFilePath * 导出文件的存放路径,包含文件名,例如,E:/test/小区公告.doc * @param data * 用来替换文档中预定义的字符串,要求预定义的字符串与 data 中的 key 值要相同 */ public static void export03WordByTemplate(String templatePath, String destFilePath, Map data) { try { WordExtractor doc = new WordExtractor(new FileInputStream( templatePath)); String content = doc.getText(); for (String key : data.keySet()) { content = content.replaceAll(key, data.get(key)); } byte b[] = content.getBytes(); ByteArrayInputStream bais = new ByteArrayInputStream(b); POIFSFileSystem fs = new POIFSFileSystem(); DirectoryEntry directory = fs.getRoot(); directory.createDocument("WordDocument", bais); FileOutputStream ostream = new FileOutputStream(destFilePath); fs.writeFilesystem(ostream); bais.close(); ostream.close(); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } public static void main(String[] args) throws Exception { Map maps = new HashMap(); maps.put("appellation", "万达公寓业主:"); maps.put( "main_body", "输出的内容"); maps.put("date", "2013年1月23日"); exportWordByTemplate("E:/sss 2.docx", "E:/test/test.doc", maps);}}"E:/sss 2.docx 模板存放的地址。
E:/test/test.doc 新生成的地址。
转载请注明出处51数据库 » sage word template