WORD转XPS格式
来源:互联网 发布:天津优化公司 编辑:程序博客网 时间:2024/06/10 21:56
using oWord = Microsoft.Office.Interop.Word;
private void button1_Click(object sender, EventArgs e)
{
if(this.openFileDialog1.ShowDialog()!=DialogResult.OK)
{
return;
}
string strWordFile = openFileDialog1.FileName;
PrintWord(strWordFile);
}
public void PrintWord(string wordfile)
{
oWord.ApplicationClass word = new oWord.ApplicationClass();
Type wordType = word.GetType();
//打开WORD文档
oWord.Documents docs = word.Documents;
Type docsType = docs.GetType();
object objDocName = wordfile;
oWord.Document doc = (oWord.Document)docsType.InvokeMember("Open", System.Reflection.BindingFlags.InvokeMethod, null, docs, new Object[] { objDocName, true, true });
//打印输出到指定文件
//可以使用 doc.PrintOut();方法,次方法调用中的参数设置较繁琐,建议使用 Type.InvokeMember 来调用时可以不用将PrintOut的参数设置全,只设置4个主要参数
Type docType = doc.GetType();
object printFileName = wordfile + ".xps";//生成的XPS文件的位置,此处还有.doc?
docType.InvokeMember("PrintOut", System.Reflection.BindingFlags.InvokeMethod, null, doc, new object[] { false, false, oWord.WdPrintOutRange.wdPrintAllDocument, printFileName });
//退出WORD
wordType.InvokeMember("Quit", System.Reflection.BindingFlags.InvokeMethod, null, word, null);
}
- WORD转XPS格式
- flash 中.Swf 格式的文字 转化为 word 或pdf 或 xps
- word 转为pdf,xps;excel转为pdf,xps
- [文档格式转换神器]pdf,jpg,xps转doc,xls,ppt等office格式
- word格式转pdf格式
- xps
- Office2007 PDF/XPS格式插件下载
- PPT格式转WORD格式,方便打印
- java word 转pdf格式
- Saving Word 2007 Documents to PDF and XPS Formats
- 文档格式转换(Office文档转成PDF或XPS)
- VSTO导出文件为pdf、xps等格式
- word格式!!!
- Java html转word,用freemark生成复杂word格式
- word转html格式的方法
- word转tif格式的类文件
- POI Word DOC格式转Html
- word文档转PDF格式怎么转换
- Web功能测试系列工具介绍-(1) MAXq
- 09年美好的第一天
- asp Split 函数的用法
- get the RGB color.
- 设计模式(Design Pattern) —— 单例模式(Singleton) (一)
- WORD转XPS格式
- 新年贺词 (用‘贺词’这个词好牵强啊 ^_^)
- 对于ASP编码问题的深入研究与最终解决方案
- 使用笔记本电脑的健康建议
- XSLT简介
- OnContextMenu事件
- slab函数分析之cache_alloc_refill
- 数据库设计理论与应用好文学习
- 不疯魔,何成活