プレゼンテーションに表示される埋め込みビデオのビデオ形式を変更したいと考えています。次のコードを使用して、ビデオ ファイルを別のフォルダーにエクスポートできます。
Dim Finame As Variant
Dim oApp As Object
Dim StoreFolder As Variant
Dim Videoname As Variant
Dim FileNameFolder As Variant
MkDir "C:\template\videoZip"
Set oApp = CreateObject("Shell.Application")
FileNameFolder = "C:\template\videoZip\"
Finame = ActivePresentation.Path & "\" & ActivePresentation.Name
StoreFolder = "C:\template\created_files\"
oApp.Namespace("C:\template\videoZip\").CopyHere Finame
Name "C:\template\videoZip\" & ActivePresentation.Name As "C:\template\videoZip\" & ActivePresentation.Name & ".zip"
oApp.Namespace(FileNameFolder).CopyHere oApp.Namespace("C:\template\videoZip\" & ActivePresentation.Name & ".zip").items
Dim firstCount As Integer
Dim lastCount As Integer
For j = 1 To videoNum
firstCount = oApp.Namespace(StoreFolder).items.count
Videoname = "C:\template\videoZip\ppt\media\media" & j & ".mp4"
oApp.Namespace(StoreFolder).CopyHere Videoname
lastCount = oApp.Namespace(StoreFolder).items.count
If firstCount = lastCount Then
MsgBox "The video has problems loading and it will not be shown (Only mp4 supported)"
End If
Next j
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.deletefolder "C:\template\videoZip"
End If
前述したように、この平和なコードにより、プレゼンテーションに含まれるすべてのビデオを取得できます。今、私はそれらのフォーマットを変更したいと思います。ffmpegを使えば可能だと聞きました。フォーマットを変更する他のソリューションも歓迎します。