文章編號: 279238 - 上次校閱: 2006年10月11日 - 版次: 2.2

PPT2000: slide.export 方法會導致錯誤時匯出為圖形

系統提示本文適用於您使用的作業系統之外的作業系統。與您不相關的文章內容已停用。

在此頁中

全部展開 | 全部摺疊

徵狀

當您使用的 投影片] 物件的 [匯出] 方法時,可能會收到下列錯誤訊息:
執行階段錯誤 '-2147467259 (80004005)'
投影片 (未知的成員): MSO9.dll 錯誤

發生的原因

當投影片包含損毀或已損毀的物件時,就會發生這個錯誤訊息。

其他可行方案

Microsoft 僅,為了說明提供程式設計範例,不提供任何明示或默示的保證。這包括,但不限於適售性或適合某特定用途之默示擔保責任。本文假設您已熟悉使用我們所示範的程式設計語言以及建立和偵錯程序所使用的工具。Microsoft 技術支援工程師可以協助解釋特定程序的功能,但它們不會修改這些範例以提供附加功能或建構程序,以符合您特定需求。
注意: 只在 PowerPoint 中的下列的巨集範例運作。Microsoft PowerPoint 檢視器不支援 Visual Basic 應用程式的巨集。如需詳細資訊按一下 [下面的文件編號,檢視 「 Microsoft 知識庫 」 中的發行項]:

圖片匯出的範例程式碼

如果要解決這個問題,使用 [匯出] 方法的 簡報 物件]。下列範例程式碼可讓您控制每個圖片檔案名稱。

附註: 下列範例程式碼需要您安裝 Microsoft Windows 指令碼主機軟體,才能嘗試執行此程式碼。如需關於 Windows 指令碼主機及何處取得它的詳細資訊,按一下下面的文件編號,檢視 「 Microsoft 知識庫 」 中的發行項:
259103? (http://support.microsoft.com/kb/259103/EN-US/ ) HOWTO: 若要自動化應用程式使用 Windows 指令碼主機
  1. 在 PowerPoint 中建立空白的簡報。
  2. 在 [工具] 功能表上指向 [巨集,然後按一下 [Visual Basic 編輯器]。
  3. 按一下 [工具] 功能表 引用項目
  4. 在 [的參考清單按一下以選取 [Microsoft 指令碼執行階段] 核取方塊。按一下 [確定]
  5. 插入] 功能表上按一下 [模組]。
  6. 在模組中輸入下列程式碼:
    Sub ExportImage()
    '
    ' Declare as a string constant which drive path
    ' you want to export the graphics to.
    ' By doing it this way, it is simple to alter the
    ' the location that you will save to.
    '
       Const strDrivePath As String = "C:\your_folder"
       Dim fsoFile As Scripting.FileSystemObject
       Dim oSlidesCount As Long
       Dim i As Long
       Dim strPadZero As String
    '
    ' Set fsoFile to Scripting's FileSystemObject.
    '
       Set fsoFile = CreateObject("Scripting.FileSystemObject")
    '
    ' Get the number of slides in the presentation.
    '
       oSlidesCount = ActivePresentation.Slides.Count
    '
    ' Using Presentation object's Export method, export the
    ' slides to the folder location of your choice.
    '
       ActivePresentation.Export strDrivePath, "JPG"
    '
    ' After the slides have been exported as graphics, use the
    ' FileSystemObject to rename the images to a name of your own
    ' choosing.
    '
       For i = 1 To oSlidesCount
    '
    ' Put leading zeros in front of the current index value if
    ' i is less than 1,000. This ensures that the images will be
    ' sorted in proper numerical order when sorted by name.
    '
          If i < 1000 Then
             strPadZero = Format(i, "000")
          Else
             strPadZero = i
          End If
    '
    ' Using the MoveFile method, rename the slide JPEGs to a name of
    ' your own choosing. In this example, they are being named:
    '    myslide_00#.jpg
    '
          fsoFile.MoveFile strDrivePath & "\SLIDE" & i & ".JPG", _
                strDrivePath & "\myslide_" & strPadZero & ".jpg"
       Next i
    
    End Sub
    					
  7. 關閉 Visual Basic 編輯程式,然後儲存簡報。
  8. 開啟您無法匯出到圖形的格式當您使用的 投影片] 物件的 [匯出] 方法的簡報。
  9. 在 [工具] 功能表上指向 [巨集,然後按一下 [巨集]。
  10. 中的巨集] 清單按一下 [所有開啟的簡報]。
  11. 按一下 [巨集] 清單中的 [ExportImage,然後按一下 [執行]。

狀況說明

Microsoft 已確認這是在本文開頭所列之 Microsoft 產品中的問題。這個問題已經在 Microsoft Office XP 中獲得修正。

這篇文章中的資訊適用於:
  • Microsoft PowerPoint 2000 Standard Edition
關鍵字:?
kbmt kbbug kbdtacode kberrmsg kbfix KB279238 KbMtzh
機器翻譯機器翻譯
重要:本文是以 Microsoft 機器翻譯軟體翻譯而成,而非使用人工翻譯而成。Microsoft 同時提供使用者人工翻譯及機器翻譯兩個版本的文章,讓使用者可以依其使用語言使用知識庫中的所有文章。但是,機器翻譯的文章可能不盡完美。這些文章中也可能出現拼字、語意或文法上的錯誤,就像外國人在使用本國語言時可能發生的錯誤。Microsoft 不為內容的翻譯錯誤或客戶對該內容的使用所產生的任何錯誤或損害負責。Microsoft也同時將不斷地就機器翻譯軟體進行更新。
按一下這裡查看此文章的英文版本:279238? (http://support.microsoft.com/kb/279238/en-us/ )
Microsoft及(或)其供應商不就任何在本伺服器上發表的文字資料及其相關圖表資訊的恰當性作任何承諾。所有文字資料及其相關圖表均以「現狀」供應,不負任何擔保責任。Microsoft及(或)其供應商謹此聲明,不負任何對與此資訊有關之擔保責任,包括關於適售性、適用於某一特定用途、權利或不侵權的明示或默示擔保責任。Microsoft及(或)其供應商無論如何不對因或與使用本伺服器上資訊或與資訊的實行有關而引起的契約、過失或其他侵權行為之訴訟中的特別的、間接的、衍生性的損害或任何因使用而喪失所導致的之損害、資料或利潤負任何責任。