par Michael DELIQUE » 25 Oct 2011 à 11:36
salut
sinon tu as ça
- Code : Tout sélectionner
Public Function WindowsUserName As String
Dim vrShell As Variant
On Error Goto CatchError
Set vrShell = CreateObject("WScript.Shell")
WindowsUserName = vrShell.ExpandEnvironmentStrings("%username%")
Set vrShell = Nothing
Exit Function
CatchError:
Msgbox "("+Structure_Log+" : "+Cstr(Getthreadinfo (1))+" Call by "+Cstr(Getthreadinfo(10))+")"+Chr(10)+"Erreur " + Str(Err) + " : "+Chr(10) + Cstr(Error)+". "+Chr(10)+"Ligne N° "+Cstr(Erl),16," ERREUR !"
WindowsUserName = ""
Exit Function
End Function
Cordialement
Michael (SMS-Phobique)
----------------------------
"La théorie, c'est quand on sait tout et que rien ne fonctionne. La pratique, c'est quand tout fonctionne et que personne ne sait pourquoi."
Albert EINSTEIN