大佬們好,我把excel中的資料匯入到lotus中的視圖,lsscript是這樣的,但有個問題,匯入的lotus里面的檔案的@DocumentUniqueID怎么動態加入?匯入的檔案沒有ID不好操作...
Sub Click(Source As Button)
Dim ws As New NotesUIWorkspace 'workspace
Dim ss As New NotesSession 'session
Dim db As NotesDatabase 'database
Dim files As Variant 'file name
Dim schar As String 'cell content
Dim doc As NotesDocument 'notes document
Dim excelapplication
Dim i,sheet
Set db = ss.currentdatabase
files = ws.openfiledialog(False,"URLDB","Excel file/*.xls")
sheet = 1
If Not(Isempty(files)) Then
Set excelapplication = createobject("excel.application")
Set excelworkbook = excelapplication.workbooks.open(files)
If excelworkbook Is Nothing Then
excelapplication.quit
Exit Sub
End If
Set excelsheet = excelworkbook.worksheets(1)
i = 2
Do Until Cstr(excelsheet.cells(i,1).value) =""
Set doc = New NotesDocument(db)
doc.Form = "MainForm"
doc.EPNo = excelsheet.cells(i,1).value
doc.TopDepart = excelsheet.cells(i,2).value
doc.DeDepart = excelsheet.cells(i,3).value
doc.Depart = excelsheet.cells(i,4).value
doc.ChineseName = excelsheet.cells(i,5).value
Call doc.save(False,False)
i=i+1
Loop
excelworkbook.close(False)
excelapplication.quit
Set excelapplication = Nothing
End If
End Sub
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/75206.html
標籤:DB2
上一篇:求查詢陳述句
