Here is a quick piece of code to get the System Temp directory to store any temporary documents. Also, this code is expected to get the directory regardless of the OS being used (of course, I have only tested it on Windows).

Declare Function w32_OSGetSystemTempDirectory Lib “nnotes” Alias
“OSGetSystemTempDirectory” ( ByVal S As String) As Integer

Declare Function mac_OSGetSystemTempDirectory Lib “NotesLib” Alias
“OSGetSystemTempDirectory” ( ByVal S As String) As Integer

Declare Function linux_OSGetSystemTempDirectory Lib “libnotes.so” Alias
“OSGetSystemTempDirectory” ( ByVal S As String) As Integer

Const ERR_UNSUPPORTED_PLATFORM = 20300

Sub Initialize
Dim filePath As String
filePath = GetNotesTempDirectory()
Msgbox filePath
End Sub

Function GetNotesTempDirectory() As String
‘ Returns the path of the temporary directory used by Notes.

Dim session As New NotesSession
Dim d As String * 256
Dim s%
Select Case session.Platform
Case “Linux”
s% = linux_OSGetSystemTempDirectory(d)
Case “Macintosh”
s% = mac_OSGetSystemTempDirectory(d)
Case “Windows/32”
s% = w32_OSGetSystemTempDirectory(d)
Case Else
Error ERR_UNSUPPORTED_PLATFORM, “In GetNotesTempDirectory, platform not supported: ” & session.Platform
End Select
GetNotesTempDirectory = Left$(d, s%)
End Function