You have to just use following code in your program to get operating system temporary directory. It is very simple program. You have to just pass path name to another variable to get operating system temporary directory. In the following program I have use two variable named as "ss" and "cs". Just try to understand it.
Code:
Private Const MAX_LENGTHs = 3245
Public Function GetTempDirectory() As String
Dim s As String
Dim c As Long
ss = Space$(MAX_LENGTHs)
cs = GetTempPath(MAX_LENGTHs, ss)
If cs > 0 Then
If cs > Len(s) Then
ss = Space$(cs + 1)
cs = GetTempPath(MAX_LENGTHs, ss)
End If
End If
GetTempDirectorys = IIf(cs > 0, Left$(ss, cs), "")
End Function
Bookmarks