xps数据怎么导出为txt_使用ExportAsFixedFormat方法将数据导出到PDF或XPS

e800

,国内最具活力的

IT

门户网站。

http://www.e800.com.cn

e800

编译】此示例演示如何使用

ExportAsFixedFormat

方法在

Microsoft Excel 2010

作表中将数据以

PDF

XPS

格式导出。

此代码段是

Office

2010

101

VBA

代码示例中的一部分。与其它示例一样,这些将

可以直接写入您的代码中。

每块示例代码包含约

5

50

行的代码,分别演示了一个独特的功能或功能集,在

VBA

VB

以及

C

#中

(在

Visual Studio 2010

中创建)

每个示例之中都会包含代码以及相应注释,

这样您就可以直接运行获取预期的结果,

或者是根据代码注释提示来调整环境,

运行示例代

码。

Microsoft

Office

2010

提供了你所需要的工具来创建功能强大的应用程序。

Microsoft

Visual

Basic

Application

(

VBA

)代码示例可以帮助你创建自己的应用程序,以执行特定功能

或者以此为出发点实现更为复杂的功能。

实例代码

Excel

2010

中新建一工作簿,并将代码复制到

Sheet1

类模块。将光标置于

TestExportAsFixedFormat

内,按

F8

单步执行代码。

Sub

TestExportAsFixedFormat()

' For information on the final parameter, see this page:

' http://msdn.microsoft.com/en-us/library/aa338206.aspx

Dim

rng

As

Range

Set

rng=Range(

"A1:E10"

)

SetupRangeDatarng

Dim

fileName

As

String

' Change this file name to meet your own needs:

fileName=

"C:\Temp\Export.pdf"

' Many of these properties are optional, and are included

' here only to demonstrate how you might use them. The

' Type parameter can be one of xlTypePDF and xlTypeXLS;

' the Quality parameter can be one of xlQualityStandard and

' xlQualityMinimum. Setting the OpenAfterPublish property

' to True will fail if you don't have a default viewer


版权声明:本文为weixin_29080033原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。