Saving Word 2. 00. Documents to PDF and XPS Formats_jz. To programmatically save a Word 2. PDF. format or the XPS format. Add a reference to the Word 1. Object Library. Import the Word 2. Create an instance of the Application.
Class. object. Declare the appropriate variables. Implement the conversion code. Add a Reference to the Word 1. Object. Library. First, add a reference to the Microsoft Word 1. Object Library. to the Visual Studio project.
若要将文件保存为 PDF 或 XPS 格式,必须首先安装 2007 Microsoft Office 系统 Save as PDF or XPS. Excel 2007, Word 2007, PowerPoint 2007, Access 2007 Edit. Microsoft Save as PDF或XPS下载,Office2007加载项:MicrooftSaveaPDF或XPS可以将我们的文档、表格、演示文稿转换为“PDF”格式的. Microsoft Office Visio 2007 1.
- Microsoft Office Word、Excel 和 PowerPoint 文件格式兼容包 打开、编辑和保存采用 Open XML 文件格式的文档、工作簿和演示文稿,这种格式是从 Office 2007 开始引入到.
- SaveAsPDFandXPS加载项是Office Word 2007中的word转pdf、word转xps的必备官方组件。微软官方出品,免费且小巧,完全不用其他word转换成pdf转换器即可.
To do this, right- click the project. Visual Studio Solution Explorer and select. Add Reference… menu item. Select the. COM tab in the Add Reference.
2007 Microsoft Office 程序的 Microsoft Save as PDF 或 XPS 加载项是 Microsoft 2007 Office system 测试版软件的补充,受其许可条款的制约。如果您没有该软件的许可.
Microsoft Word 1. Object Library component, select it, and then click.
OK to add the reference. Figure 1. Adding a Reference. Word 2. 00. 7 Documents to PDF and XPS Formats" /> 2. Import the Word Interop Namespace. Next, import the Microsoft. Office. Interop. Word.
This allows objects that are defined in that namespace. To import the namespace, add the following line to. Microsoft. Office. Interop. Word; For Microsoft Visual Basic projects, you can also import the. Visual. Studio Solution Explorer and selecting the.
欢迎下载 Microsoft Save as PDF或XPS 此下载使您得以在八种2007MicrosoftOffice程序中导出文件并将其保存为PDF和XPS格式。. Office Word 2007安全更新 星级. 2007 Microsoft Office 系列插件: Microsoft Save as XPS or PDF 这个插件允许你在8个Office 2007程序里输出XPS和PDF文件,同样允许将XPS文件作为附件. 官网下载了SAVE AS PDF AND XPS插件,word文件想要转换成PDF选项中没有PDF,在线客服建议下载SAVE AD PDF. Office 2007 安装、升级和激活 适用于 1 次.
Properties menu item. On the project properties. References tab and then select. Microsoft. Office. Interop. Word entry in the list of. Create an Instance of the Word Application.
Class. Object. To work with the Word 2. Word 2. 00. 7 top- level Application. Class object. and declare a variable to hold the reference to the document. Application. Class word.
Application = new Application. Class(). Document word. Document = null; 4.
Declare Appropriate Variables. The following code blocks declare variables that help to make. The following variables are used with the.
Documents. Open method and. Application. Class. Quit method. Use the param. Source. Doc. Path variable to specify the.
Word 2. 00. 7 document that is to be exported. PDF format or the XPS format.
Use the param. Missing variable when calling methods. Optional parameters are only. Microsoft Visual Basic. You must specify a.
Microsoft Visual C#. Using Type. Missing as the value for an optional. Source. Doc. Path =.
C: \Temp\Test. docx". Missing = Type. Missing; The following variables are used with the. Document. Export. As. Fixed. Format method. The. param. Export.
Format variable is important because it is. The. param. Export. Format variable is of the. Wd. Export. Format type. It is an enumerated type.
Export. Format. XPS and. Export. Format. PDF. The following sample code sets the. Export. Format variable to the. Wd. Export. Format.
Export. Format. XPS value to export a. XPS format. To change the code to export a document. PDF format, set the variable to the. Wd. Export. Format. Export. Format. PDF value.
For more. information on the Export. As. Fixed. Format method and. Docment. Export. As. Fixed. Format. string param. Export. File. Path =. C: \Temp\Test. xps". Wd. Export. Format param.
Export. Format =. Wd. Export. Format. Export. Format. XPS. Open. After. Export = false. Wd. Export. Optimize.
For param. Export. Optimize. For =. Wd.
Export. Optimize. For. wd. Export. Optimize. For. Print; Wd. Export.
Range param. Export. Range =. Wd. Export. Range. wd. Export.
All. Document; int param. Start. Page = 0; int param. End. Page = 0; Wd.
Export. Item param. Export. Item =. Wd. Export. Item. wd. Export. Document.
Content; bool param. Include. Doc. Props = true; bool param. Keep. IRM = true; Wd. Export. Create. Bookmarks param.
Create. Bookmarks =. Wd. Export. Create. Bookmarks. wd. Export. Create. Word. Bookmarks; bool param. Doc. Structure. Tags = true; bool param.
Bitmap. Missing. Fonts = true; bool param. Use. ISO1. 90. 05_1 = false; 5. Implement the Conversion Code. Next add code that opens the source document, exports it to the. Word 2. 00. 7. Making the call to the. Document. Export.
As. Fixed. Format method throws an. To handle this situation, the conversion code is wrapped in a. Try…Catch block. The code that exits Word 2. Finally block. The shutdown- related code closes. Word 2. 00. 7 document, exits the Word 2.
Word 2. 00. 7 COM objects, and makes calls. NET garbage collector. For more information about how to. COM objects when you use managed code, see. Chapter 2: Basics of Office Interoperability (Part. Microsoft . NET Development for Microsoft. Open the source document. word.
Document =. word. Application. Documents. Open( ref param. Source. Doc. Path.
Missing, ref param. Missing, ref param. Missing, ref. param. Missing, ref param. Missing, ref param.
Missing, ref. param. Missing, ref param. Missing, ref param. Missing, ref. param.
Missing, ref param. Missing, ref param. Missing, ref. param.
Missing, ref param. Missing, ref param. Missing); // Export it in the specified format. if (word. Document != null). Document. Export.
As. Fixed. Format(param. Export. File. Path.
Export. Format, param. Open. After. Export. Export. Optimize. For, param. Export. Range, param. Start. Page. param. End.
Page, param. Export. Item, param. Include. Doc. Props. param. Keep. IRM, param. Create. Bookmarks, param.
Doc. Structure. Tags. Bitmap. Missing. Fonts, param. Use. ISO1. 90. 05_1. Missing); }catch (Exception ex){ // Respond to the error}finally{ // Close and release the Document object. if (word. Document != null) { word. Document. Close(ref.
Missing, ref param. Missing. ref param. Missing); word. Document =. null; } // Quit Word and release the Application. Class. object. if (word. Application != null) { word. Application. Quit(ref.
Missing, ref param. Missing. ref param. Missing); word. Application =. null; } GC.
Collect(); GC. Wait. For. Pending. Finalizers(); GC. Collect(); GC. Wait. For. Pending. Finalizers(); }There are a number of scenarios in which you may want to develop. Microsoft Office business application that requires both dynamic. In Word 2. 00. 7 you can use the.
Microsoft Office Add- in: Microsoft Save as. Microsoft Office Add- in: Microsoft Save as.
XPS to save a Word 2. PDF document or an. XPS document. The key object that is used to save a Word 2. PDF format or the XPS format is the. Document object. The Document. Document. Export.
As. Fixed. Format, which has a number. This article specifically explores how to use.
Documents. Open method and. Document. Export. As. Fixed. Format method to. Word 2. 00. 7 document as either a PDF document.
XPS document. To programmatically save a Word 2. PDF. document or an XPS document. Add a reference to the Word 1. Object Library to the project. This marks that the project uses the Word 1.
Object Library. Import the Microsoft. Office. Interop. Word. This allows code to use the classes and types exposed as.
Microsoft. Office. Interop. Word. namespace without having to specify the fully qualified namespace.
Create an instance of the Word 2. Application. Class object. This is the top- most. Word 2. 00. 7 object model hierarchy, and is the starting. Declare variables to help with method calls. This helps to make. Implement the conversion code.
The final step provides code to.