VBA. Bureau du PC
Le
DAH
Bonjour,
Sous Windows et Me le répertoire du Bureau est toujours
'C:\Windows\Bureau' Mais sur Windows XP le répertoire du bureau est
'C:\Documents and Settings\NomUtilisateur\Bureau'. Existe-t-il une
variable d'environnement donnant le répertoire du Bureau ? Ou comment faire
autrement ?
Merci d'avance pour votre aide.
--
@+
David
Sous Windows et Me le répertoire du Bureau est toujours
'C:\Windows\Bureau' Mais sur Windows XP le répertoire du bureau est
'C:\Documents and Settings\NomUtilisateur\Bureau'. Existe-t-il une
variable d'environnement donnant le répertoire du Bureau ? Ou comment faire
autrement ?
Merci d'avance pour votre aide.
--
@+
David

Poser une question


Private Declare Function SHGetFolderPath& Lib "ShFolder" Alias "SHGetFolderPathA"
_
(ByVal hwnd&, ByVal csidl&, ByVal handle&, ByVal flags&, ByVal lpPath$)
Sub DeskPath()
Dim sPath As String
sPath = String(260, 0)
SHGetFolderPath 0, &H0, 0, 0, sPath
MsgBox Left(sPath, InStr(sPath, vbNullChar) - 1)
End Sub
MP
"DAH" news:bo5b49$rb9$
Autre approche :
'================= Sub test()
MsgBox CreateObject("WScript.Shell").SpecialFolders("Desktop")
End Sub
'=================
FS
--
Frédéric Sigonneau [MVP Excel - né un sans-culottide]
Gestions de temps, VBA pour Excel :
http://perso.wanadoo.fr/frederic.sigonneau
Si votre question sur Excel est urgente, évitez ma bal !