徐々に追加する。
L版横置き用紙設定
ActivePresentation.PageSetup.SlideSize = ppSlideSizeCustom: ActivePresentation.PageSetup.SlideWidth = 12.7# * 28.3464567: ActivePresentation.PageSetup.SlideHeight = 8.9# * 28.3464567
L版縦置き用紙設定
ActivePresentation.PageSetup.SlideSize = ppSlideSizeCustom: ActivePresentation.PageSetup.SlideWidth = 8.9# * 28.3464567: ActivePresentation.PageSetup.SlideHeight = 12.7# * 28.3464567
jpegで出力
ActivePresentation.Slides(ActiveWindow.Selection.SlideRange.SlideIndex).Export Environ$("USERPROFILE") & "\Downloads\out.jpg", "JPG", 3000, CLng(3000 * ActivePresentation.PageSetup.SlideHeight / ActivePresentation.PageSetup.SlideWidth)
幅3000pxで縦は比率を維持した形でjpegをダウンロードフォルダに出力
実行方法
- パワポが起動している状態で
-
ALT + F11でVBE起動 -
CTL + Gでイミディエイトペインを開き - 上記ワンライナーをペーストしてエンター
ワンライナー集を作った背景
- PowerPointについてるCopilotで「L版の用紙設定して」と命令しても操作方法を言葉で説明するだけで使い物にならない(2026-03-04 現在)
- パワポを本気で自動操作できるのはVBA
- だがマクロつきドキュメントの配布の制約はますばかり
- だったらワンライナーで配布するのが到達しやすい
- テキストのコピペはだれにも止められない