Home > database >  Lotus import excel, to join the document ID
Lotus import excel, to join the document ID

Time:09-25

Good bosses, I put the excel data imported into the view of the lotus, lsscript is like that, but there is a problem, the import of lotus documentation @ DocumentUniqueID how dynamic join in it? The imported document no ID not good operation...

 
Sub Click (Source As a Button)

Dim the ws As New NotesUIWorkspace 'workspace
Dim ss As New NotesSession 'session
Dim the db As NotesDatabase 'database
Dim files As the Variant: 'the file name
Dim schar As String 'cell content
Dim doc As NotesDocument 'notes document
Dim excelapplication
Dim I, sheet
Set the db=ss. Currentdatabase
Files=ws. Openfiledialog (False, "URLDB", "Excel file/*. XLS")
Sheet=1
If Not (Isempty (files) Then
The Set excelapplication=createobject (" excel. Application ")
The Set excelworkbook=excelapplication. Workbooks. Open (files)

If excelworkbook Is Nothing Then
Excelapplication. Quit
The Exit Sub
End the If
The Set excelsheet=excelworkbook. Worksheets (1)
I=2

Do Until Cstr (excelsheet cells (I, 1). The value)=""
The Set doc=New NotesDocument (db)

Doc. Form="MainForm"
Doc. EPNo=excelsheet. Cells (I, 1). The value
Doc. TopDepart=excelsheet. Cells (I, 2). The value
Doc. DeDepart=excelsheet. Cells (I, 3). The value
Doc. Depart=excelsheet. Cells (I, 4). The value
Doc. ChineseName=excelsheet. Cells (I, 5). The value

Call doc. Save (False, False)
I=I + 1
Loop
Excelworkbook. Close (False)
Excelapplication. Quit
The Set excelapplication=Nothing
End the If
End Sub
  •  Tags:  
  • DB2
  • Related