WEBの画面をスクリーンショットして
新しいスライドに貼り付けようとしたらうまくいきません。
マクロはエクセルと同じだろうと思って
実行ボタンを押すと5行目のWaitに青く印がついて
Application.Wait Now + TimeSerial(0, 0, 5)
コンパイルエラー
メソッドが見つかりません と出ます。
5行目を実行しないようにして進めていくと
VBAプログラムを書いているページが貼り付けされました。
すみませんが、指定したWEBアドレスのスクリーンショットを
取ってくる方法を教えて戴けませんでしょうか。
パワーポイントは2002か2007です。
それと
最後は、WEB画面でなくて パワーポイントの画面になってくれたらなあと思います。
下のはエクセルで動いたものをパワーポイントに持ってきたものです。
どうぞよろしくお願い致します。
Private Declare PtrSafe Sub keybd_event Lib "user32" ( _
ByVal bVk As Byte, _
ByVal bScan As Byte, _
ByVal dwFlags As Long, _
ByVal dwExtraInfo As Long _
)
Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
(ByVal hwnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, _
ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Sub スクショ()
Dim URL As String, rc
URL = "https://www.moug.net/"
rc = ShellExecute(0, "Open", URL, "", "", 1)
'Application.Wait Now + TimeSerial(0, 0, 5)
keybd_event &H2C, 0, 0, 0& 'Print screen押す
keybd_event &H2C, 0, 2, 0& 'Print screen上げる
With ActivePresentation
.Slides(1).Shapes.Paste
End With
End Sub