Having found some code in the sand box to create ndl files (notes document links) for e-mailing Outlook users- I want to find the current user’s temp directory- the sand box code puts the file in the root of C:\ - not a great place for creating files- I have looked through these forums- don’t find it. And the VP forums on the web, seem to come close- I cant type echo %temp% and get the temp directory- must be a way to capture it. Ideas?Tom
Subject: LS- finding user’s Temp directory
Try one of these two methods
Declare Function GetTempPath Lib “kernel32” Alias “GetTempPathA” (Byval nBufferLength As Long, Byval lpBuffer As String) As Long
Sub Click(Source As Button)
Dim tempPath
If Environ$("tmp") <> "" Then
tempPath = Environ$("tmp")
Else
tempPath = Environ$("temp")
End If
Print "Method 1 - tempPath=" + tempPath
Dim retval As Long
Dim buf As String * 512
retval = GetTempPath(512, buf)
Print "Method 2 - tempPath=" + buf
End Sub
Subject: -