そのため、ドキュメントとして使用するスピーカー モードで実行される約 1000 のパワーポイント スライドショー (*.pps) があります。
ユーザーが手動で前後にスクロールすることを禁止し、ESC キーでスライドショーを閉じるだけにしたいと考えています。これは、キオスクモードが完全に適合する場所です。そのため、これらすべてのファイルをキオスク モードに変換する必要があり、手動では行いません。既に解決策を確認しましたが、見つかったのは古い PowerPoint Viewer コマンド "/K" だけでした。http://www.pptfaq.com/FAQ00528_Command_Line_Switches_-_PowerPoint_and_PowerPoint_Viewers.htm
もう 1 つのオプションは PowerPoint Viewer を使用することでしたが、既定ではキオスク モードでスライドショーを開く方法がないため、このオプションも失敗します。
誰かが解決策を知っているか、私を正しい方向に導いてくれることを本当に願っています。
更新 1:
@Steve Rindsberg ご協力いただきありがとうございます。あなたのコードとここにあるコードを組み合わせました: http://www.pptalchemy.co.uk/file_scripting.html
次のようになります。
Sub getfiles(strpath As String)
Dim PPT As PowerPoint.Application
Dim fso As Object
Dim objfolder As Object
Dim objfile As Object
Dim opres As PowerPoint.Presentation
Dim strSuffix As String
Dim objsub As Object
strSuffix = "*.pp*" 'File suffix note * is wild card
Set fso = CreateObject("Scripting.FileSystemObject")
Set objfolder = fso.GetFolder(strpath)
' main folder
For Each objfile In objfolder.Files
If objfile.Name Like strSuffix Then
Set PPT = New PowerPoint.Application
Set opres = PPT.Presentations.Open(objfile.Path, msoFalse)
If objfile.Name Like "*.pps*" Then
opres.NewWindow
End If
opres.SlideShowSettings.ShowType = ppShowTypeKiosk
opres.Save
opres.Close
PPT.Quit
End If
Next objfile
' Sub Folders
For Each objsub In objfolder.SubFolders
Call getfiles(objsub.Path)
Next objsub
Set objsub = Nothing
Set objfile = Nothing
Set objfolder = Nothing
Set opres = Nothing
Set PPT = Nothing
End Sub
見つかった最初のファイルは問題なく動作しますが、2 番目のファイルには次のエラー メッセージが
表示されますopres.SlideShowSettings.ShowType = ppShowTypeKiosk
。問題が一部であることはわかっていますがopres
、解決策が何であるかを理解できないようです。
更新 2: :D を理解しました。Powerpoint.Application が既に存在するかどうかを確認するステートメントを作成しましたが、問題なく動作するようになりました。提案はいつでも歓迎されますが、私にとっては質問は終了しました。助けてくれてありがとう
私の最終的なコード:
Sub getfiles(strpath As String)
Dim PPT As PowerPoint.Application
Dim fso As Object
Dim objfolder As Object
Dim objfile As Object
Dim opres As PowerPoint.Presentation
Dim strSuffix As String
Dim objsub As Object
strSuffix = "*.pp*" 'File suffix note * is wild card
Set fso = CreateObject("Scripting.FileSystemObject")
Set objfolder = fso.GetFolder(strpath)
' main folder
For Each objfile In objfolder.Files
If objfile.Name Like strSuffix Then
If PPT Is Nothing Then
Set PPT = New PowerPoint.Application
Else
End If
Set opres = PPT.Presentations.Open(objfile.Path, msoFalse)
If objfile.Name Like "*.pps*" Then
opres.NewWindow
End If
opres.SlideShowSettings.ShowType = ppShowTypeKiosk
opres.Save
opres.Close
End If
Next objfile
' Sub Folders
For Each objsub In objfolder.SubFolders
Call getfiles(objsub.Path)
Next objsub
Set objsub = Nothing
Set objfile = Nothing
Set objfolder = Nothing
Set opres = Nothing
Set PPT = Nothing
End Sub