Lotus导入excel,那个文档ID怎么加入

lyroot 2018-12-26 04:05:11
大佬们好,我把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
...全文
50 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

5,889

社区成员

发帖
与我相关
我的任务
社区描述
IBM DB2 是美国IBM公司开发的一套关系型数据库管理系统,它主要的运行环境为UNIX(包括IBM自家的AIX)、Linux、IBM i(旧称OS/400)、z/OS,以及Windows服务器版本
社区管理员
  • DB2
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧