1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
| Option Explicit
'Variables globales
Dim bPasswordBoxWait,bPasswordBoxOkay,sPass,Password
sPass = "mdp"
Password = PasswordBox("Veuillez taper votre mot de passe pour l'envoi du mail",False)' Taille réduite
If Password = sPass Then
MsgBox "Mot de passe est correct",VbInformation,"Mot de passe est correct"
'Call Envoi_mail
Else
MsgBox "Mot de passe est incorrect",VbCritical,"Mot de passe est incorrect"
End If
'**********************************************************************************************************************************************************
Function PasswordBox(sTitle,FullScreen)
Dim oIE
set oIE = CreateObject("InternetExplorer.Application")
With oIE
If FullScreen = True Then
.FullScreen = True
Else
.FullScreen = False
End if
.ToolBar = False : .RegisterAsDropTarget = False
.StatusBar = False : .Navigate("about:blank")
.Resizable = False
While .Busy : WScript.Sleep 100 : Wend
With .document
.Title = "Veuillez taper votre mot de passe * * * * * * * * * * * * *"
With .ParentWindow
.resizeto 450,120
.moveto .screen.width/2-200, .screen.height/2-50
End With
.WriteLn("<html><title>Veuillez taper votre mot de passe * * * * * * * * * * * * * * * *</title><body text=white bgColor=DarkOrange><center>")
.WriteLn(sTitle)
.WriteLn("<input type=password value=mdp id=pass>" & _
"<input type=Submit id=but0 value=Envoyer>")
.WriteLn("</center></body></html>")
With .ParentWindow.document.body
.scroll="no"
.style.borderStyle = "outset"
.style.borderWidth = "1px"
End With
.all.but0.onclick = getref("PasswordBox_Submit")
.all.pass.focus
oIE.Visible = True
bPasswordBoxOkay = False : bPasswordBoxWait = True
On Error Resume Next
While bPasswordBoxWait
WScript.Sleep 100
if oIE.Visible Then bPasswordBoxWait = bPasswordBoxWait
if Err Then bPasswordBoxWait = False
Wend
PasswordBox = .all.pass.value
End With ' document
.Visible = False
.Quit
End With ' IE
End Function
'***********************************************************************************************************************************************************
Sub PasswordBox_Submit()
bPasswordBoxWait = False
End Sub
'*********************************************************************************************************************************************************** |
Partager