当前位置:首页
开发技术指南» 文章正文
    引言:
 

 

 ·复制问题    »显示摘要«
    摘要: 各位大哥: 小弟请问如何进行复制文件操作!谢谢了! ......
    摘要: 在第一章提到消息映射的雏形,给出了两个数组 一个是messageentries,一个是commandentries 可还是不明白,create这种message为什么不能当作command? 谁能给我讲讲command和message的区别? ......


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

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

NO.1   作者: gisgis

vba

NO.2   作者: swallowsea

如果是C/S也可采用ole

NO.3   作者: swallowsea

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   dont   want   to   show   Word.  
  word.quit   remove   comment   if   you   want   to   close   rather   than   show   Word.  
  End   Sub  
     
  这样会不会!

NO.4   作者: grassky

是用VBA编程吧

NO.5   作者: lixuran

关注

NO.6   作者: cgs1999

当然是商业秘密,至少在我们公司是这样的,可以跟你透露  
  是在word中用vba实现的

NO.7   作者: firesyang

不要用ole了  
   
  会使系统不稳定的  
   
  直接操作附件吧

NO.8   作者: firesyang

就像邮件中的附件一样,把一个文件附加到某个RTF域保存,而不是使用OLE对象的形式,同时利用lotusscript和VBA,打开这个附件并进行操作,早把它重新保存的RTF域里

NO.9   作者: gjd111686

第一你创建Word对象后将Application隐藏后执行代码就可以  
  第二你可以自己建一个Com封装一下[将word9.olb导入就可以了.]

NO.10   作者: gjd111686

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模式下是可以实现的.


    摘要: 有个理解,不知道对不对。 学习vc要想入门,起码的先了解界面编程 请指点。 各位进来的大哥大姐们,请教一些电子版书籍的下载地址: c++和vc的 妈妈的,什么时候我也成为一高手该多有快感啊!!!!!!! 我可怜的50分啊, 请不吝指教! ......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE