标题:如何修改程序,使之放入表单中也能使用
取消只看楼主
王咸美
Rank: 1
等 级:新手上路
帖 子:569
专家分:0
注 册:2018-1-4
结帖率:96.99%
已结贴  问题点数:20 回复次数:0 
如何修改程序,使之放入表单中也能使用
如何修改下列程序,使之放入表单中也能使用(放入表单click事件中)

 SET TALK OFF
 SET SAFETY OFF
 CLOSE ALL
 CLEAR

 wjm=SYS(5)+SYS(2003)+"\grkbmb.doc"
 WordApp=CREATEOBJECT("Word.application")

 USE jsmd ALIAS jsmd IN 0
 USE jsrkb ALIAS jsrkb IN 0
 USE rkzb201803 ALIAS rkzb201803 IN 0

 SELECT jsmd
 GOTO top
 rkmc=""
 SCAN
     xm=ALLTRIM(姓名)
     rkmc=xm+","
     WordTable=WordApp.Application.Documents.Open(wjm)
     WordApp.Visible =.t.
     SELECT jsrkb
     GOTO top
     SCAN
         FOR i=1 TO 18
             m=FIELD(i)
             xm2= &m.
             IF ALLTRIM(xm2)=ALLTRIM(xm) then
                rkmc=rkmc+FIELD(i)+nj+bj+','
                zk( m,nj,bj)
             ENDIF
        NEXT i
     ENDSCAN
     WORDAPP.ActiveDocument.Content.Find.Execute('ABCDEF',.F.,.F.,.F.,.F.,.F.,.F.,.F.,.F.,'&xm',2)
     oFile=SYS(5)+SYS(2003)+"\"+ALLTRIM(xm)+"_课程表.doc"
     WordApp.Documents(1).SaveAs(oFile)
     WordApp.ActiveDocument.Close      
     SELECT jsmd
 ENDSCAN
 WORDAPP.quit
 WORDAPP=.NULL.
 CLOSE ALL
 QUIT
  
 PROCEDURE zk
     LPARAMETERS kcm,lnj,lbj
     LOCAL j,zkm,xq,jc,zkkm
      
     SELECT rkzb201803
     GOTO top
     LOCATE FOR ALLTRIM(nj)=ALLTRIM(lnj) AND ALLTRIM(bj)=ALLTRIM(lbj)
     IF NOT EOF() THEN
        FOR j=3 TO 32
            zkm=FIELD(j)
            zkkm= &zkm.
            IF ALLTRIM(zkkm)=ALLTRIM(kcm) then
               xq=VAL(SUBSTR(zkm,5,1))
               jc=VAL(SUBSTR(zkm,6,1))
               scsz=ALLTRIM(nj)+ALLTRIM(bj)+ALLTRIM(kcm)
               WordTable.Tables.item(1).Cell(jc+1,xq+2).Range.Text="&scsz"
            ENDIF
        NEXT j
     ENDIF
     SELECT jsrkb
     RETURN
搜索更多相关主题的帖子: 修改 表单 SELECT GOTO top 
2018-04-16 07:36



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-486097-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.013069 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved