您的位置:程序门 -> 企业开发 -> lotus



请教如何编写lotus script代理程序把notes附件保存到本地


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


请教如何编写lotus script代理程序把notes附件保存到本地[已结贴,结贴人:wjh3303]
发表于:2007-03-19 09:32:02 楼主
如何编写lotus   script代理程序把notes附件保存到本地,请大侠多多帮忙!
发表于:2007-03-19 09:56:471楼 得分:25
dim   object   as   notesembeddedobject
  set   object   =   cdoc.getattachment(filename)
  if   not(   object   is   nothing   )   then
    driverdir=path+object.name
    driverdir=replace(driverdir, "\\ ", "\ ") 'replace函数将 "\\ "转换成 "\ "
    call   object.extractfile(driverdir)
  end   if
filename为你要把附件保存到本地磁盘的路径
发表于:2007-03-19 09:58:392楼 得分:5
打错
filename是附件名
driverdir是把附件保存到本地磁盘的路径
发表于:2007-03-19 10:22:353楼 得分:0
请教cdoc要不要定义
发表于:2007-03-19 10:44:294楼 得分:0
当然是你带有附件的哪个文档
发表于:2007-03-19 10:44:495楼 得分:10
记得给分,呵呵
发表于:2007-03-19 10:46:446楼 得分:10
lotus技术交流   37459714   欢迎加入
发表于:2007-03-19 10:53:317楼 得分:0
好的   有没有完整的代码     我不怎么知道写全代码   谢谢!
发表于:2007-03-19 13:58:488楼 得分:0
sky0321能不能帮忙一下,我会把全部分数给你的
发表于:2007-03-19 15:12:059楼 得分:50
dim   session   as   new   notessession
  dim   db   as   notesdatabase
  dim   doc   as   notesdocument
  dim   cdoc   as   notesdocument
  set   db   =   session.currentdatabase
  set   cdoc   =   session.documentcontext
  path   =curdrive$()+ "\lotus\domino\data\domino\html\ " '这在里指定硬盘路径
  filename=cdoc.filename(0) '得到上传附件的名称,form提交时可以用js把附件名放入filename域中
  dim   object   as   notesembeddedobject
  set   object   =   cdoc.getattachment(filename)
  if   not(   object   is   nothing   )   then
    driverdir=path+object.name
    driverdir=replace(driverdir, "\\ ", "\ ") 'replace函数将 "\\ "转换成 "\ "
    call   object.extractfile(driverdir)
  end   if
'curdrive$()函数得到当前domino所在目录.
发表于:2007-03-19 15:22:3610楼 得分:0
非常感谢!以后还会有问题向您请教!请多多指点!
发表于:2007-03-19 15:27:1011楼 得分:0
sub   initialize
dim   session   as   new   notessession
dim   db   as   notesdatabase
dim   vw   as   notesview
dim   doc   as   notesdocument
dim   object   as   notesembeddedobject
dim   ritem   as   variant
dim   count   as   integer

set   db   =   session.currentdatabase
set   vw   =   db.getview( "test ")
set   doc   =   vw.getdocumentbykey( "test ")
set   ritem   =   doc.getfirstitem( "rtf ")
count   =   0
if   (ritem.type   =   richtext)   then
forall   o   in   ritem.embeddedobjects  
if   (   o.type   =   embed_attachment   )   then
count   =   count   +   1
call   o.extractfile(   "c:\newfile "   &   cstr(count)   )
end   if
end   forall
end   if
end   sub
发表于:2007-06-11 11:55:5012楼 得分:0
上面的方法是保存到服务器的文件夹。
可以保存到客户端吗?


快速检索

最新资讯
热门点击