简体   繁体   中英

Can I enable “Save Preview Picture” on PowerPoint Presentation properties

I am trying to use C# PowerPoint interop to enable the "Save Preview Picture" option on a PowerPoint presentation.

在此处输入图片说明

I am looking at MSDN Presentation Properties but cannot see a property to save a thumbnail or similar.. Is it possible?

In case it proves useful, here's a bit of VBA that will display the values of all the built-in document properties. Some will throw errors if the presentation has not yet been saved. Unfortunately, SavePreviewPicture or the like isn't on the list.

Dim x As Long
On Error Resume Next
With ActivePresentation
    Debug.Print "There are: " & .BuiltInDocumentProperties.Count & " built-in document properties"
    With .BuiltInDocumentProperties
        For x = 1 To .Count
            Debug.Print x & vbTab & .Item(x).Name
            Debug.Print vbTab & .Item(x).Value
            If Err.Number <> 0 Then
                Debug.Print vbTab & "Error: " & Err.Number & vbTab & Err.Description
                Err.Clear
            End If
        Next
    End With
End With

This is a workaround. You just have to interact with the properties dialog twice. And translate menu names in the marcro to your Office Language

Sub UpdateThumbnailWorkaround()
Dim path As String
Dim vPpt As Presentation

    Dim oCmdbar As CommandBar
    Set oCmdbar = Application.CommandBars("Menu Bar")
    oCmdbar.Controls("&Archivo").Controls("&Propiedades").Execute
    path = ActivePresentation.path & "\" & ActivePresentation.Name
    ActivePresentation.Save
    ActivePresentation.Close
    Set vPpt = Application.Presentations.Open(path)
    'Set ActiveWindow.Presentation = vPpt
    Set oCmdbar = Application.CommandBars("Menu Bar")
    oCmdbar.Controls("&Archivo").Controls("&Propiedades").Execute


    'oCmdbar.Controls("&Archivo").Controls("&Propiedades").Execute
    ActivePresentation.Save
    ActivePresentation.Close
    Application.Presentations.Open (path)        

End Sub

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM