您的位置:首页 > 其它

从文档中分离excel附件到磁盘,再打开该xls文件

2011-08-03 10:52 197 查看
 Dim   s   As   New   notessession

 Dim db As notesdatabase

 Dim view As NotesView

 Dim   doc   As   NotesDocument

 Dim neo As NotesEmbeddedObject

 Dim temVar As Variant

 Dim rtitem As NotesRichTextItem

 

 'Dim tempNeo As NotesEmbeddedObject

 

 Set db = s.CurrentDatabase

 Set view = db.GetView("dywdgl(bytime)")

 Set doc = view.GetFirstDocument

 

 If doc.HasEmbedded Then

  Msgbox("有附件")

 End If

 

 Set   rtitem   =   doc.GetFirstItem(   "zhengwen"   ) 

 Forall   o   In   rtitem.EmbeddedObjects 

  '把附件拆出来

  Call o.ExtractFile("d:\Lotus\Domino\Data\"+o.Name)

 End   Forall

 Set   excelapplication   =   CreateObject ( "Excel.Application")

 Set   excelworkbook   =   excelapplication.Workbooks.Open ("d:\123.xls")

 Messagebox ("已经打开xls文件")

 excelworkbook.close(False)

 excelapplication.quit

 Set excelapplication=Nothing
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  excel 磁盘 文档 lotus
相关文章推荐