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?
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