共用方式為


使用部分檔

當您開啟具有大型內容的簡報時,PowerPoint 可能會以部分檔的方式提供檔。 這可讓您快速開啟、編輯及共同處理檔,而較大的媒體元件 (例如影片) ,則會繼續在背景載入。 同樣地,由於媒體會與檔的其餘部分分開處理,因此在共同作業會話期間插入媒體時,共同作業會更順暢。

因為某些內容一開始可以延遲,所以在載入延遲的內容之前,無法採取某些動作。 此外,還有某些動作,例如另存新檔、匯出至視訊等。在下載所有延遲的內容之前,將無法運作。 如果您起始其中一個作業,PowerPoint 會顯示 UI 通知您下載進度,但無法進行程式設計作業。 如果您在內容仍在下載時,以程式設計方式嘗試呼叫 API 來執行動作,則會失敗。

Run-time error '-2147188128 (80048260)':
<object> (unknown member) : This method isn't supported until the presentation is fully downloaded. Visit this URL for more information: https://go.microsoft.com/fwlink/?linkid=2172228

瞭解完整下載狀態

若要瞭解簡報是否以程式設計方式完整下載,您可以先查詢 Presentation.IsFullyDownloaded 屬性,再呼叫任何受影響的 API。

If ActivePresentation.IsFullyDownloaded Then
    MsgBox "Presentation download is complete."
Else
    MsgBox "PowerPoint is still downloading the presentation."
End If

錯誤處理

您也可以新增一些錯誤處理來擷取失敗,並在完整下載簡報之後重試作業。 如果錯誤值為 -21471881280x80048260 ,則作業失敗,因為未完整下載簡報。 使用 Err.Number 作為識別這些失敗的索引鍵,如下列範例所示。

Sub TestCopySlide()
    On Error GoTo eh    
    ActivePresentation.Slides(1).Copy    
    Exit Sub
eh:
    If Err.Number = -2147188128 Then
        MsgBox "Cannot copy because the presentation is not fully downloaded."
    Else
        MsgBox "Failure is due to a reason other than incomplete download: " & Err.Description.
    End If
    Debug.Print Err.Number, Err.Description
End Sub

受影響的 API

以下是受影響的 OM API 呼叫清單,可能會傳回錯誤碼:

名稱
Presentation.Export
Presentation.ExportAsFixedFormat
Presentation.ExportAsFixedFormat2
Presentation.SaveAs
Presentation.SaveCopyAs
Presentation.SaveCopyAs2
Presentation.Password
Presentation.WritePassword
Selection.Copy
Selection.Cut
Shape.Copy
Shape.Cut
ShapeRange.Cut
ShapeRange.Copy
Shapes.Paste
Shapes.PasteSpecial
Slide.Copy
Slide.Cut
Slide.Export
SlideRange.Copy
SlideRange.Cut
SlideRange.Export
Slides.Paste
CustomLayouts.Paste
View.Paste
View.PasteSpecial
MediaFormat.Resample
MediaFormat.ResampleFromProfile
Player.Play

支援和意見反應

有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應