Sample code used for importing the data from .txt file to notes using LotusScript.
code started from below :
Sub Initialize
On Error Goto Errhandler
Dim session As New NotesSession
Dim uiws As New NotesUIWorkspace
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim fileName As Variant
Dim counter As Integer
Dim PaintName As String
Dim coatColor As String
Set db= session.CurrentDatabase
fileName= uiws.OpenFileDialog(False,"Test","*.txt","folderlocation")
FileNum% = Freefile()
If Not Isempty(fileName) Then
Open fileName(0) For Input As FileNum%
Do Until Eof(FileNum%)
Input #FileNum%, PaintName, CoatColor
Set doc= db.CreateDocument
With doc
.paintName=PaintName
.CoatColor=CoatColor
End With
Call doc.save(False,False)
counter=counter+1
Loop
End If
Exit Sub
Errhandler:
Msgbox "Error on line number : " & Erl &" Error description : " & Error()
End Sub
code started from below :
Sub Initialize
On Error Goto Errhandler
Dim session As New NotesSession
Dim uiws As New NotesUIWorkspace
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim fileName As Variant
Dim counter As Integer
Dim PaintName As String
Dim coatColor As String
Set db= session.CurrentDatabase
fileName= uiws.OpenFileDialog(False,"Test","*.txt","folderlocation")
FileNum% = Freefile()
If Not Isempty(fileName) Then
Open fileName(0) For Input As FileNum%
Do Until Eof(FileNum%)
Input #FileNum%, PaintName, CoatColor
Set doc= db.CreateDocument
With doc
.paintName=PaintName
.CoatColor=CoatColor
End With
Call doc.save(False,False)
counter=counter+1
Loop
End If
Exit Sub
Errhandler:
Msgbox "Error on line number : " & Erl &" Error description : " & Error()
End Sub
No comments:
Post a Comment