软件工程

本类阅读TOP10

·PHP4 + MYSQL + APACHE 在 WIN 系统下的安装、配置
·Linux 入门常用命令(1)
·Linux 入门常用命令(2)
·使用 DCPROMO/FORCEREMOVAL 命令强制将 Active Directory 域控制器降级
·DirectShow学习(八): CBaseRender类及相应Pin类的源代码分析
·基于ICE方式SIP信令穿透Symmetric NAT技术研究
·Windows 2003网络负载均衡的实现
·一网打尽Win十四种系统故障解决方法
·数百种 Windows 软件的免费替代品列表
·收藏---行百里半九十

分类导航
VC语言Delphi
VB语言ASP
PerlJava
Script数据库
其他语言游戏开发
文件格式网站制作
软件工程.NET开发
通过Domino COM实现Web的痕迹保留设计思路

作者:未知 来源:月光软件站 加入时间:2005-2-28 月光软件站

总体思路:

实现步骤:
1,客户端注册NOTES COM控件。(regsvr32 c:\lotus\notes\DOMOBJ.TLB)regsvr32  c:\lotus\notes\nlsxbe.dll
2,在公文数据库中,保存一些已经定制好的公文模板。已供新建公文时使用。
3,表单上加入VBScript将附件从服务器拆离到本地,然后起用WORD。(Word的宏安全性设为中)
4,公文模板中,WORD的文档的退出事件中加入VBA代码,实现文件上传到服务器。

注:为避免启动COM时出现提示口令输入框,可以通过API制作一个DLL来避开。(参考:API例子的)

相关代码:
 表单上的VBScript代码:
<SCRIPT LANGUAGE="VBScript">
Sub Button1_OnClick
    dim s, dir, db, doc, eo, no, word, worddoc
    Set s = CreateObject("Lotus.NotesSession")
    Call s.Initialize
    Set db = s.GetDatabase("sh_server","intranet\webtemp.nsf")
    Set doc = db.getDocumentByUNID("30C11B03D279463548256C7D000DDD74")
    Set eo = doc.getAttachment("普通公文.doc")
    Call eo.ExtractFile( "C:\Temp\test.doc")
  'Create the Word object:
  Set word = CreateObject("Word.Application") 'Create Word object
  Call word.documents.open( "C:\Temp\test.doc" ) 
  Set worddoc = word.activedocument 'Get a handle for the active document
  word.visible = True
    'Call eo.remove
    'Set ritem = doc.getFirstItem("rtfAttachment")
    'Set no = ritem.EmbedObject(1454, "" , "C:\Temp\test.doc" )
    'Call doc.save(True,False)
    'MsgBox db.filename + " & " + db.server,, "Databases on " + db.server
End Sub
</SCRIPT>
 表单上的按钮代码:
<INPUT NAME="Button1" TYPE="BUTTON" VALUE="编辑正文">


Word模板上的VBA代码:
Private Sub Document_Close()
    ActiveDocument.Save
    Dim s, dir, db, doc, eo, no, word, worddoc
    Set s = CreateObject("Lotus.NotesSession")
    Call s.Initialize
    Set db = s.GetDatabase("sh_server", "intranet\webtemp.nsf")
    Set doc = db.GetDocumentByUNID("C47E90193C0E4D3248256C780006A73E")
    Set eo = doc.GetAttachment("普通公文.doc")
    Call eo.Remove
    Set ritem = doc.GetFirstItem("rtfAttachment")
    Set no = ritem.EmbedObject(1454, "", "C:\Temp\test.doc")
    Call doc.Save(True, False)
    MsgBox db.FileName + " 文件已上传至服务器!& " + db.Server, , "Databases on " + db.Server
End Sub




相关文章

相关软件