cens
04-10-2013, 06:05 AM
Hi,
I want to use this code to make a movie from PP
Sub TestCreateSampleVideo()
' Change the file path and name as required.
CreateSampleVideo ActivePresentation, "C:\TEMP\Video.wmv"
End Sub
Sub CreateSampleVideo(pres As Presentation, fileName As String)
' Presentation.CreateVideo does its work asynchronously.
' You can use the Presentation.CreateVideoStatus property
' to periodically check the status, and react accordingly.
pres.CreateVideo fileName, DefaultSlideDuration:=1, VertResolution:=480
' Now wait for the conversion to be complete:
Do
' Don't tie up the user interface; add DoEvents
' to give the mouse and keyboard time to keep up.
DoEvents
Select Case pres.CreateVideoStatus
Case PpMediaTaskStatus.ppMediaTaskStatusDone
MsgBox "Conversion complete!"
Exit Do
Case PpMediaTaskStatus.ppMediaTaskStatusFailed
MsgBox "Conversion failed!"
Exit Do
Case PpMediaTaskStatus.ppMediaTaskStatusInProgress
Debug.Print "Conversion in progress"
Case PpMediaTaskStatus.ppMediaTaskStatusNone
' You'll get this value when you ask for the status
' and no conversion is happening or has completed.
Case PpMediaTaskStatus.ppMediaTaskStatusQueued
Debug.Print "Conversion queued"
End Select
Loop
End Sub
When you run this macro, it stop and wait for mouse click or move in active PP window (top bar of window). If you don't click, macro is still waiting. It is visible on progress bar at the bottom of window (is visible only after click, then it start make video).
Have you got any idea how to force macro to make a movie without click/move? I need this automaticly,
I want to use this code to make a movie from PP
Sub TestCreateSampleVideo()
' Change the file path and name as required.
CreateSampleVideo ActivePresentation, "C:\TEMP\Video.wmv"
End Sub
Sub CreateSampleVideo(pres As Presentation, fileName As String)
' Presentation.CreateVideo does its work asynchronously.
' You can use the Presentation.CreateVideoStatus property
' to periodically check the status, and react accordingly.
pres.CreateVideo fileName, DefaultSlideDuration:=1, VertResolution:=480
' Now wait for the conversion to be complete:
Do
' Don't tie up the user interface; add DoEvents
' to give the mouse and keyboard time to keep up.
DoEvents
Select Case pres.CreateVideoStatus
Case PpMediaTaskStatus.ppMediaTaskStatusDone
MsgBox "Conversion complete!"
Exit Do
Case PpMediaTaskStatus.ppMediaTaskStatusFailed
MsgBox "Conversion failed!"
Exit Do
Case PpMediaTaskStatus.ppMediaTaskStatusInProgress
Debug.Print "Conversion in progress"
Case PpMediaTaskStatus.ppMediaTaskStatusNone
' You'll get this value when you ask for the status
' and no conversion is happening or has completed.
Case PpMediaTaskStatus.ppMediaTaskStatusQueued
Debug.Print "Conversion queued"
End Select
Loop
End Sub
When you run this macro, it stop and wait for mouse click or move in active PP window (top bar of window). If you don't click, macro is still waiting. It is visible on progress bar at the bottom of window (is visible only after click, then it start make video).
Have you got any idea how to force macro to make a movie without click/move? I need this automaticly,