API版:
Public Declare Funсtion SHGetSpecialFolderLocation Lib "Shell32" (ByVal hwndOwner As Long, ByVal nFolder As Integer, ppidl As Long) As Long
Public Declare Funсtion SHGetPathFromIDList Lib "Shell32" Alias "SHGetPathFromIDListA" (ByVal pidl As Long, ByVal szPath As String) As Long
Sub Main()
Dim Tmp As String * 256
Dim pidl As Long
Dim TStr As String
SHGetSpecialFolderLocation 0, $2E, pidl
SHGetPathFromIDList pidl, sTmp
TStr = Left(Tmp, InStr(Tmp, Chr(0)) - 1)
MsgBox "我的文档路径:" & TStr
End Sub