求助:notes中对word(OLEObject)进行操作的方法

wjzmy 2003-09-24 01:32:10
我要实现的是修改留痕功能,我希望修改后的文档基础上,自动再生成一个没有痕迹的文档。也就是说,修改一次,就多出一份文档,并且该文档,我可以定义名字。
我希望用在notes里面用代码的形式来加载word中的动作。也就是说,我在designer中写代码,要求word给出动作---比如实现新建,拷贝,及接受修订等动作。
希望可以给出一个大概的想法代码或是例子!!!

(难点是如何实现在notes中对word的操作!以及如何在notes中打开word文档而不是创建)
...全文
76 17 打赏 收藏 转发到动态 举报
写回复
用AI写文章
17 条回复
切换为时间正序
请发表友善的回复…
发表回复
gjd111686 2003-10-08
  • 打赏
  • 举报
回复
Set word = CreateObject("Word.Application") 'Create Word object
Call word.documents.add("C:\Documents and Settings\user\My Documents\Return and Uplift.dot") 'Create a new document based on the template "Return and Uplift.Dot"
Set worddoc = word.activedocument 'Get a handle for the active document
这写有了就可以
worddoc.Content.Copy
worddoc.Content.Paste
worddoc.saveas了.
如果不是就用我第二中方法,我在B/S模式下是可以实现的.
gjd111686 2003-10-08
  • 打赏
  • 举报
回复
第一你创建Word对象后将Application隐藏后执行代码就可以
第二你可以自己建一个Com封装一下[将word9.olb导入就可以了.]
wjzmy 2003-10-08
  • 打赏
  • 举报
回复
真的没人帮我吗?
firesyang 2003-09-27
  • 打赏
  • 举报
回复
不要用ole了

会使系统不稳定的

直接操作附件吧
cgs1999 2003-09-27
  • 打赏
  • 举报
回复
当然是商业秘密,至少在我们公司是这样的,可以跟你透露
是在word中用vba实现的
wjzmy 2003-09-27
  • 打赏
  • 举报
回复
怎么打开这个附件呢?

我不会这个代码!!

可以帮帮我吗?
firesyang 2003-09-27
  • 打赏
  • 举报
回复
就像邮件中的附件一样,把一个文件附加到某个RTF域保存,而不是使用OLE对象的形式,同时利用lotusscript和VBA,打开这个附件并进行操作,早把它重新保存的RTF域里
wjzmy 2003-09-27
  • 打赏
  • 举报
回复
大家既然说了,就说的详细点好吗?

什么是vba编程?

怎样直接操作附件呢!
lixuran 2003-09-26
  • 打赏
  • 举报
回复
关注
wjzmy 2003-09-26
  • 打赏
  • 举报
回复
啊!?!?

商业秘密!?!?

大哥,如果是这样的话,还存在互帮互助吗!?!?
cgs1999 2003-09-25
  • 打赏
  • 举报
回复
这可是商业秘密哦,我可不想丢掉这份工作。
grassky 2003-09-25
  • 打赏
  • 举报
回复
是用VBA编程吧
wjzmy 2003-09-25
  • 打赏
  • 举报
回复
唉,大哥,你误会我的意思了!

你写的这些我都实现了!

我的意思是怎么样在notes里面对word实现新建,拷贝,粘贴,保存等功能。

不只是单纯的赋值啊!

不过还是谢谢你!
swallowsea 2003-09-25
  • 打赏
  • 举报
回复
Sub Click(Source As Button)

Dim s As New notessession
Dim todaydate As New notesdatetime("Today")

Dim word As Variant
Dim wordoc As Variant

Dim todaysdate As String
Dim orderid As String
Dim producedby As String
Dim storeid As String
Dim customername As String
Dim address As String
Dim citytown As String
Dim postcode As String
Dim daytimeno As String
Dim eveningno As String

'Predefined values: (replace with field values from uidoc)
todaysdate = todaydate.localtime
orderid = "2183763248"
producedby = s.username
storeid = "12345"
customername = "John Doe"
address = "Apartment 5c, 5 Test Avenue"
citytown = "Testtown"
postcode = "XX5 5XX"
daytimeno = "1234567890"
eveningno = "0987654321"

'Create the Word object:
Set word = CreateObject("Word.Application") 'Create Word object
Call word.documents.add("C:\Documents and Settings\user\My Documents\Return and Uplift.dot") 'Create a new document based on the template "Return and Uplift.Dot"
Set worddoc = word.activedocument 'Get a handle for the active document

'Assign the field values:
worddoc.FormFields(1).result = todaysdate
worddoc.FormFields(2).result = orderid
worddoc.FormFields(3).result = producedby
worddoc.FormFields(4).result = storeid
worddoc.FormFields(5).result = customername
worddoc.FormFields(6).result = address
worddoc.FormFields(7).result = citytown
worddoc.FormFields(8).result = postcode
worddoc.FormFields(9).result = daytimeno
worddoc.FormFields(10).result = eveningno

worddoc.saveas(customername) 'save the document with the filename of "John Doe.doc"
word.visible = True 'Comment this line if you don't want to show Word.
'word.quit 'remove comment if you want to close rather than show Word.
End Sub

这样会不会!
wjzmy 2003-09-24
  • 打赏
  • 举报
回复
但是怎么解决这个问题啊!

现在用的就是ole
swallowsea 2003-09-24
  • 打赏
  • 举报
回复
如果是C/S也可采用ole
gisgis 2003-09-24
  • 打赏
  • 举报
回复
vba

535

社区成员

发帖
与我相关
我的任务
社区描述
企业开发 Exchange Server
社区管理员
  • 消息协作社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧