Document.ExportAsFixedFormat 方法

定義

使用 PDF 或 XPS 格式儲存文件。

public void ExportAsFixedFormat (string OutputFileName, Microsoft.Office.Interop.Word.WdExportFormat ExportFormat, bool OpenAfterExport = false, Microsoft.Office.Interop.Word.WdExportOptimizeFor OptimizeFor = Microsoft.Office.Interop.Word.WdExportOptimizeFor.wdExportOptimizeForPrint, Microsoft.Office.Interop.Word.WdExportRange Range = Microsoft.Office.Interop.Word.WdExportRange.wdExportAllDocument, int From = 1, int To = 1, Microsoft.Office.Interop.Word.WdExportItem Item = Microsoft.Office.Interop.Word.WdExportItem.wdExportDocumentContent, bool IncludeDocProps = false, bool KeepIRM = true, Microsoft.Office.Interop.Word.WdExportCreateBookmarks CreateBookmarks = Microsoft.Office.Interop.Word.WdExportCreateBookmarks.wdExportCreateNoBookmarks, bool DocStructureTags = true, bool BitmapMissingFonts = true, bool UseISO19005_1 = false, ref object FixedFormatExtClassPtr);
abstract member ExportAsFixedFormat : string * Microsoft.Office.Interop.Word.WdExportFormat * bool * Microsoft.Office.Interop.Word.WdExportOptimizeFor * Microsoft.Office.Interop.Word.WdExportRange * int * int * Microsoft.Office.Interop.Word.WdExportItem * bool * bool * Microsoft.Office.Interop.Word.WdExportCreateBookmarks * bool * bool * bool * obj -> unit
Public Sub ExportAsFixedFormat (OutputFileName As String, ExportFormat As WdExportFormat, Optional OpenAfterExport As Boolean = false, Optional OptimizeFor As WdExportOptimizeFor = Microsoft.Office.Interop.Word.WdExportOptimizeFor.wdExportOptimizeForPrint, Optional Range As WdExportRange = Microsoft.Office.Interop.Word.WdExportRange.wdExportAllDocument, Optional From As Integer = 1, Optional To As Integer = 1, Optional Item As WdExportItem = Microsoft.Office.Interop.Word.WdExportItem.wdExportDocumentContent, Optional IncludeDocProps As Boolean = false, Optional KeepIRM As Boolean = true, Optional CreateBookmarks As WdExportCreateBookmarks = Microsoft.Office.Interop.Word.WdExportCreateBookmarks.wdExportCreateNoBookmarks, Optional DocStructureTags As Boolean = true, Optional BitmapMissingFonts As Boolean = true, Optional UseISO19005_1 As Boolean = false, Optional ByRef FixedFormatExtClassPtr As Object)

參數

OutputFileName
String

新的 PDF 或 XPS 檔案的路徑和檔案名稱。

ExportFormat
WdExportFormat

其中一個 WdExportFormat 值,指定要以 PDF 還是 XPS 格式儲存文件。

OpenAfterExport
Boolean

true 表示要自動開啟新檔案,否則為 false

OptimizeFor
WdExportOptimizeFor

其中一個 WdExportOptimizeFor 值,指定要針對螢幕輸出還是列印作業進行最佳化。

Range
WdExportRange

其中一個 WdExportRange 值,指定匯出範圍是整份文件、目前頁面、文字範圍,還是目前選取範圍。 預設為匯出整份文件。

From
Int32

如果 Range 參數設定 wdExportFromTo為 ,則指定起始頁碼。

To
Int32

如果 Range 參數設定 wdExportFromTo為 ,則指定結束頁碼。

Item
WdExportItem

其中一個 WdExportItem 值,指定匯出處理序只包括文字,還是連同文字和標記都包括在內。

IncludeDocProps
Boolean

true 表示要在新檔案中包含文件摘要資訊,否則為 false

KeepIRM
Boolean

true 表示要將資訊版權管理 (IRM) 權限複製到 XPS 文件 (如果來源文件有 IRM 保護的話),否則為 false。 預設為 true

CreateBookmarks
WdExportCreateBookmarks

其中一個 WdExportCreateBookmarks 值,指定是否匯出書籤,以及指定要匯出的書籤類型。

DocStructureTags
Boolean

true 表示要包含額外資料 (例如,內容之流程和邏輯組織的相關資訊) 以協助螢幕助讀員,否則為 false。 預設為 true

BitmapMissingFonts
Boolean

true 表示要包含文字的點陣圖;false 表示要參考文字字型。 當字型授權不允許將字型嵌入 PDF 檔案時,請將這個參數設定為 true。 如果您將這個參數設定為 false,且指定的字型無法使用,則檢閱者的電腦會以適當的字型來替代。 預設為 true

UseISO19005_1
Boolean

true 表示限制 PDF 使用依循 ISO 19005-1 標準化的 PDF 子集,否則為 false。 如果您將這個參數設定為 true,則產生的檔案會更確實地獨立 (Self-Contained),但由於格式的限制,可能變得較大或出現更多視覺疊影。 預設為 false

FixedFormatExtClassPtr
Object

IMsoDocExporter 介面的實作之指標,能夠以不同的固定格式儲存文件。 如需詳細資訊,請參閱<擴充 Office (2007) 固定格式匯出功能>。

備註

只有在安裝提供此功能的載入宏之後,才能從 Microsoft Office Word 儲存為 PDF 或 XPS 檔案。 如需詳細資訊,請在 Office Online 上搜尋「啟用其他檔格式的支援,例如 PDF 和 XPS」。

選擇性參數

如需選擇性參數的資訊,請參閱 Office 方案中的選擇性參數

適用於