CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
可用分押宝游戏火热进行中... 专题改版:Java Web 专题
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  企业开发 >  Lotus

怎样将notes导入excel中?

楼主youyiyang(oh,lotus)2005-08-02 22:38:44 在 企业开发 / Lotus 提问

上次问过怎样将excel导入notes,现在我想问怎样将notes导入excel中,有没有代码可供参考?谢谢了! 问题点数:50、回复次数:9Top

1 楼loadagain(最后一只妖怪)回复于 2005-08-02 23:38:33 得分 15

dim   s   as   new   notesSession  
  dim   db   as   notesDatabase  
  dim   docs   as   notesDocumentcollection  
  dim   doc   as   notesdocument  
   
  dim   xlsApp  
   
  set   db=s.currentdatabase  
  set   docs=db.unprocesseddocuments  
   
  set   xlsApp=createobject("excel.application")  
  xlsApp.workbooks.add  
  xlsApp.visible=true  
   
  for   i=1   to   docs.count  
  set   doc=docs.getnthdocument(i)  
  xlsApp.cells(i,1)=doc.subject(0)  
  next   i  
   
  set   xlsApp=nothing  
  set   doc=nothing  
  set   docs=nothing  
  set   db=nothing  
  set   s=nothingTop

2 楼CrazyNotes(疯狂的人)回复于 2005-08-03 09:19:51 得分 5

如果你是web应用的话,你可以参考一下owc。也就是office   web   components。Top

3 楼xjunhua(沉思的森林)回复于 2005-08-03 09:28:11 得分 30

再贴一个  
   
  Sub   Click(Source   As   Button)  
   
  Dim   ws   As   New   NotesUIWorkspace  
  Dim   uidoc   As   NotesUIDocument  
  Dim   curdoc   As   NotesDocument  
  Set   uidoc   =   ws.CurrentDocument  
   
  Dim   db   As   NotesDatabase  
  Dim   view   As   NotesView  
  Dim   doc   As   NotesDocument  
  Dim   session   As   New   NotesSession  
  Dim   excelApplication   As   Variant  
  Dim   excelWorkbook   As   Variant  
  Dim   excelSheet   As   Variant  
  Dim   collection   As   notesdocumentcollection    
   
  Dim   i,index1,index2   As   Integer  
   
  filenames   =   ws.SaveFileDialog(False,"导出到Excel",,   "D:\",   "assets.xls")  
   
  If   Isempty(filenames)   Then   Exit   Sub  
   
  Set   excelApplication   =   CreateObject("Excel.Application")  
  excelApplication.Visible   =   True  
  Set   excelWorkbook   =   excelApplication.Workbooks.Add  
  Set   excelSheet   =   excelWorkbook.Worksheets("Sheet1")  
   
  '根据选中要导出的字段来设置excle的第一列  
   
  excelSheet.Cells(1,1).Value   =   "资产编号"  
  excelSheet.Cells(1,2).Value   =   "资产名称"  
  excelSheet.Cells(1,3).Value   =   "规格型号"  
  excelSheet.Cells(1,4).Value   =   "具体配置"  
  excelSheet.Cells(1,5).Value   =   "使用部门"  
  excelSheet.Cells(1,6).Value   =   "责任人"  
   
  i   =   2  
  Set   db   =   session.CurrentDatabase  
   
  '如果直接从当前视图导出  
  Set   collection   =   db.UnprocessedDocuments    
  Set   doc   =   collection.GetFirstDocument()  
   
  If   (doc   Is   Nothing)   Then   Messagebox("请选择你要导出的记录!")  
   
  While   Not(doc   Is   Nothing)  
  excelSheet.Cells(i,1).Value   =   doc.NumberID(0)  
  excelSheet.Cells(i,2).Value   =   doc.pc(0)  
   
  excelSheet.Cells(i,3).Value   =   doc.Brand(0)+"     "+doc.Type1(0)  
  excelSheet.Cells(i,4).Value   =   ""  
  excelSheet.Cells(i,5).Value   =   doc.BU(0)+"/"+doc.CDep(0)  
  excelSheet.Cells(i,6).Value   =   doc.owner(0)  
   
  Set   doc   =   collection.GetNextDocument(doc)  
  'Set   doc   =   view.GetNextDocument(doc)  
  Wend  
   
  excelWorkbook.SaveAs(filenames(0))  
  excelApplication.Quit  
  Set   excelApplication   =   Nothing  
   
  'Call   uidoc.Close()  
   
  End   SubTop

4 楼glassch(:雪融:)回复于 2005-08-03 11:48:09 得分 0

同意,同意,Top

5 楼Spring1981(飞天侠)回复于 2005-08-04 10:36:11 得分 0

看不懂,学习中...........Top

6 楼youyiyang(oh,lotus)回复于 2005-08-07 22:29:18 得分 0

To   xjunhua(沉思的森林),你好:  
  怎样将RTF域上的文字内容导入到EXCEL中去?Top

7 楼kingchang2000(骠骑大将)回复于 2005-08-08 10:05:12 得分 0

...  
   
  代码都有了,还不会吗?Top

8 楼youyiyang(oh,lotus)回复于 2005-08-08 22:07:39 得分 0

代码都有了,我也试过了,可以用。  
  代码我是读懂了。我现在的问题是,在表单上有一个RTF域,   我想将此RTF域中的文字导入excel的cell中去,源代码会报错,“variant   does   not   contain   a   container”,然后程序就停在那儿了。我试过NotesRichTextItem的GetFormattedText方法和NotesItem的text属性,但还有问题。  
  请问该怎么写可以做到这一点呢?Top

9 楼xjunhua(沉思的森林)回复于 2005-08-08 22:35:15 得分 0

直接   doc.item   就可以了Top

相关问题

  • excel怎么导入notes?
  • 怎样从excel中导入数据
  • 怎样将EXCEL文件导入ACCESS中??
  • 怎样将Excel导入Sql中
  • 怎样把DBGrid全部导入Excel表格里?
  • 请教!怎样将sql2000下的表导入到Excel中!
  • 怎样将EXCEL数据导入数据库
  • 怎样用ASP将Excel表格数据导入Oracle?
  • 怎样把Excel的数据导入到Access数据库中
  • 怎样把excel文件导入表里,在线等待!

关键词

  • excel
  • 代码
  • notes
  • ws
  • db
  • excelsheet
  • nothingset
  • xlsapp
  • 导入
  • variantdim

得分解答快速导航

  • 帖主:youyiyang
  • loadagain
  • CrazyNotes
  • xjunhua

相关链接

  • CSDN Blog
  • 技术文档
  • 代码下载
  • 第二书店
  • 读书频道

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
世纪乐知(北京)网络技术有限公司 版权所有, 京 ICP 证 020026 号
北京创新乐知广告有限公司 提供技术支持
Copyright © 2000-2007, CSDN.NET, All Rights Reserved
GongshangLogo