惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

P
Proofpoint News Feed
Blog — PlanetScale
Blog — PlanetScale
GbyAI
GbyAI
C
Check Point Blog
腾讯CDC
Stack Overflow Blog
Stack Overflow Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
The GitHub Blog
The GitHub Blog
A
About on SuperTechFans
Recent Announcements
Recent Announcements
L
LangChain Blog
Microsoft Azure Blog
Microsoft Azure Blog
小众软件
小众软件
J
Java Code Geeks
博客园_首页
Jina AI
Jina AI
美团技术团队
H
Help Net Security
MyScale Blog
MyScale Blog
Engineering at Meta
Engineering at Meta
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
人人都是产品经理
人人都是产品经理
Y
Y Combinator Blog
S
SegmentFault 最新的问题

博客园 - 风渐寒pro

mysql的1067错误 Sharepoint门户可以干很多事情的 利用 Lotus Notes API 提高自动化测试效率(转) sharepoint2010,I am coming! - 风渐寒pro sharepoint安全性验证无效的一个问题 REST实现原理浅析(转载) 山人自有妙招-sharepoint正式环境不能调试 Sharepoint ListType Id 使用 SharePoint 2007 进行安全性编程(转) sharepoint2010的控制台程序,找不到位于<url>的应用程序 - 风渐寒pro - 博客园 Customizing the Rendering of a Custom SPField (copy from todd's blog) extJS中AsyncTreeNode使用多个loader Sharepoint文档权限审计控制小尝试 又是未写完的IDI Repository模式(转) Oracle和Tomcat端口冲突 实现domino平台上的本地word编辑 转帖:ESB拓扑方案 转载:LOTUS还能活多久
某个domino的word公文本地编辑实现方案
风渐寒pro · 2008-11-24 · via 博客园 - 风渐寒pro

实现步骤:

1,客户端注册NOTES COM控件。(regsvr32 c:\lotus\notes\DOMOBJ.TLB)regsvr32  c:\lotus\notes\nlsxbe.dll

(笔者注:注册domino 的com组件是用的nlsxbe.dll,而不是domobj.tlb.这个让我郁闷了半天.)

2,在公文数据库中,保存一些已经定制好的公文模板。已供新建公文时使用。

3,表单上加入VBScript将附件从服务器拆离到本地,然后起用WORD。(Word的宏安全性设为中)

4,公文模板中,WORD的文档的退出事件中加入VBA代码,实现文件上传到服务器。 (笔者注:见过某个公司的OA是写的关闭时自动保存.)

注:为避免启动COM时出现提示口令输入框,可以通过API制作一个DLL来避开。(笔者注:就是用c api做一个domino的登陆验证filter)

相关代码:

表单上的VBScript代码:

  1. <SCRIPT LANGUAGE="VBScript">
  2. Sub Button1_OnClick
  3.     dim s, dir, db, doc, eo, no, word, worddoc
  4.     Set s = CreateObject("Lotus.NotesSession")
  5.     Call s.Initialize
  6.     Set db = s.GetDatabase("sh_server","intranet\webtemp.nsf")
  7.     Set doc = db.getDocumentByUNID("30C11B03D279463548256C7D000DDD74")
  8.     Set eo = doc.getAttachment("普通公文.doc")
  9.     Call eo.ExtractFile( "C:\Temp\test.doc")
  10.   'Create the Word object:
  11.   Set word = CreateObject("Word.Application") 'Create Word object
  12.   Call word.documents.open( "C:\Temp\test.doc" ) 
  13.   Set worddoc = word.activedocument 'Get a handle for the active document
  14.   word.visible = True
  15.     'Call eo.remove
  16.     'Set ritem = doc.getFirstItem("rtfAttachment")
  17.     'Set no = ritem.EmbedObject(1454, "" , "C:\Temp\test.doc" )
  18.     'Call doc.save(True,False)administrator
  19.     ad
  20.     'MsgBox db.filename + " & " + db.server,, "Databases on " + db.server
  21. End Sub
  22. </SCRIPT>

表单上的按钮代码:

  1. <INPUT NAME="Button1" TYPE="BUTTON" VALUE="编辑正文">

Word模板上的VBA代码:

  1. Private Sub Document_Close()
  2.     ActiveDocument.Save
  3.     Dim s, dir, db, doc, eo, no, word, worddoc
  4.     Set s = CreateObject("Lotus.NotesSession")
  5.     Call s.Initialize
  6.     Set db = s.GetDatabase("sh_server""intranet\webtemp.nsf")
  7.     Set doc = db.GetDocumentByUNID("C47E90193C0E4D3248256C780006A73E")
  8.     Set eo = doc.GetAttachment("普通公文.doc")
  9.     Call eo.Remove
  10.     Set ritem = doc.GetFirstItem("rtfAttachment")
  11.     Set no = ritem.EmbedObject(1454, """C:\Temp\test.doc")
  12.     Call doc.Save(True, False)
  13.     MsgBox db.FileName + " 文件已上传至服务器!& " + db.Server, , "Databases on " + db.Server
  14. End Sub

上述内容还少了一个步骤,用js创建文件流将服务器上的文件下载到客户端本地。