Normally when we want to open/save a file through lotus script we will be using the open file dialog and save file dialog. Here is an API alternative for that.
NNOTESWS.DLL is part of the Lotus Notes software and handles the interface side of the Notes client like file open dialog, file save dialog, progress bar etc..
Please Note: I have tried the below code on Version 6.5.4. I haven't tried it on other versions.
Open File Dialog
'Declartion
Declare Function NEMGetFile Lib "nnotesws" ( wHandle As Integer, Byval szFileName As String, Byval szFilter As String, Byval szTitle As String ) As Integer
'On Click
'Declare variables...
Dim szFileName As String*256
Dim szTitle As String
Dim szFilter As String
Dim szSelectedFile As String
Set values...
szFilename = Chr(0)
szTitle = "Open File"
szFilter = "All Files *.* Word Document *.docText Files*.txt" ' a pipe symbol should come after every entry. (szFilter = "All Files pipe *.* pipe Word Document pipe *.doc pipe Text Filespipe .txt pipe"). The symbol gets missed when i publish.
If NEMGetFile( 0, szFileName, szFilter, szTitle) <> 0 Then
szSelectedFile = szFileName
End If
Save As Dialog:
'Declaration
Declare Function NEMPutFile Lib "nnotesws" ( wHandle As Integer, Byval szFileName As String, Byval szFilter As String, Byval szTitle As String ) As Integer
'On Click
'Declare variables...
Dim szFileName As String*256
Dim szTitle As String
Dim szFilter As String
Set values...
szFilename = Chr(0)
szTitle = "Save File"
szFilter = "All Files *.*Word Document *.docText Files*.txt" 'a pipe symbol should come after every entry. (szFilter = "All Files pipe *.* pipe Word Document pipe *.doc pipe Text Filespipe .txt pipe"). The symbol gets missed when i publish.
If NEMPutFile( 0, szFileName, szFilter, szTitle) <> 0 Then
szSaveFile = szFileName
End If