Lotus script 打开现有文件向胡据库导入数据

参考 


Sub   Click(Source   As   Button)

Dim   ws   As   New   notesuiworkspace 
Dim   ss   As   New   notessession 
Dim   db   As   notesdatabase 
Dim   item   As   notesitem 
Dim   files   As   Variant 
Dim   schar   As   String 
Dim   doc   As   NotesDocument 
Dim   cpdoc   As   NotesDocument 
Dim   excelapplication 
Dim   i,sheet 

Set   db   =   ss.currentdatabase 
files   =   ws.openfiledialog(False, "请选择要导入的Excel文件 ", "Excel   file/*.xls ") 
If   Not(Isempty(files))   Then 
Set   excelapplication   =   createobject( "excel.application ") 
Set   excelworkbook   =   excelapplication.workbooks.open(files) 

Set   excelsheet   =   excelworkbook.worksheets(1) 
i   =   2 

Do   Until   Cstr(excelsheet.cells(i,1).value)   = " " 
Set   cpdoc   =   New   notesdocument(db) 

cpdoc.NumberID   =   excelsheet.cells(i,1).value 
cpdoc.company   =   excelsheet.cells(i,2).value 

i   =   i+1


Loop 

excelworkbook.close(False) 
excelapplication.quit 
Set   excelapplication   =   Nothing 

End   If 

End   Sub

你可能感兴趣的:(Lotus开发分类)