Jeg prøvede forskellige muligheder med denne uden at få det til at virke:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odeopg/html/deovrreturningstringsfromdllfunctions.aspDeclare Function GetTempPath Lib "kernel32" Alias "GetTempPathA" _
(ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long
Property Get GetTempFolder() As String
' Returns the path to the user's Temp folder. To boot, Windows
' requires that a temporary folder exist, so this should always
' safely return a path to one. Just in case, though, check the
' return value of GetTempPath.
Dim strTempPath As String
Dim lngTempPath As Long
' Fill string with null characters.
strTempPath = String(144, vbNullChar)
' Get length of string.
lngTempPath = Len(strTempPath)
' Call GetTempPath, passing in string length and string.
If (GetTempPath(lngTempPath, strTempPath) > 0) Then
' GetTempPath returns path into string.
' Truncate string at first null character.
GetTempFolder = Left(strTempPath, _
InStr(1, strTempPath, vbNullChar) - 1)
Else
GetTempFolder = ""
End If
End Property