按键精灵代码实现凭证录入

UserVar x =120 "设置延时"
Delay x
k3 = Plugin.Window.Find(0, "总账系统 - [记账凭证 - 修改 (1/1)]")
Delay x
//这里设置的初始EXCEL表的表名称为其它出库1,有需要可以自行更改。
E = Plugin.Window.Find(1, "其他出库1")
Delay x
当前窗口 = Plugin.Window.Foreground()
sText = Plugin.Window.GetTextEx(当前窗口, 0)
//MessageBox left(stext, 4)
If left(stext, 4) <> "其他出库" Then
ExitScript
End If
//Call Plugin.Office.OpenXls("D:\其他出库1.xls")
//For Ex = 1 To 72
// For ey = 1 To 5
// TT = Plugin.Office.ReadXls(1, ex, ey)
// Delay x
// MessageBox t1
// Delay x
// Next
//Next
//For 5
//Call Plugin.Window.Active(E)
//复制Ctrl +C
//Call Plugin.Bkgnd.KeyDown(E, 17)
//Call Plugin.Bkgnd.KeyPress(E, 67)
//Call Plugin.Bkgnd.KeyUp(E, 17)
//Delay x
//向右Tab
//Call Plugin.Bkgnd.KeyPress(E, 9)
//Delay x
//激活k3,进入到金蝶中粘贴具体数据。
//Call Plugin.Window.Active(k3)
//Delay x
//粘贴
//Call Plugin.Bkgnd.KeyDown(E, 17)
//Call Plugin.Bkgnd.KeyPress(E, 86)
//Call Plugin.Bkgnd.KeyUp(E, 17)
//Delay x
//删除
//Call Plugin.Bkgnd.KeyPress(E, 86)
//Delay x
//Call Plugin.Bkgnd.KeyPress(E, 86)
//Delay x
//回车
//Call Plugin.Bkgnd.KeyPress(E, 13)
//Next

For 4
KeyDown 17, 1
KeyPress 67, 1
KeyUp 17, 1
Delay x
jin=0
jianqie = Plugin.Sys.GetCLB()
If len(Trim(jianqie)) = 2 Then
Call 金额
jin =1
Exit For
End If
KeyPress "Tab", 1
Delay x
KeyDown 18, 1
KeyPress 9, 1
KeyUp 18, 1
Delay x
KeyDown 17, 1
KeyPress 86, 1
KeyUp 17, 1
Delay x
KeyPress "BackSpace", 2
Delay x
KeyPress "Enter", 1
Delay x
KeyDown 18, 1
KeyPress 9, 1
KeyUp 18, 1
Delay x
Next

If jin=0 then
Call 金额
End If


KeyPress "Enter", 1
Delay x

Sub 金额
Delay x
KeyPress "Home", 1
Delay x
KeyPress "Tab", 4
Delay x
KeyDown 17, 1
KeyPress 67, 1
KeyUp 17, 1
Delay x
a = Plugin.Sys.GetCLB()
Delay x
KeyDown 18, 1
KeyPress 9, 1
KeyUp 18, 1
Delay x
For y = 1 To 15
SayString Mid(a, y, 1)
Delay x
Next
Delay x
KeyPress "Enter", 1
Delay x
KeyDown 18, 1
KeyPress 9, 1
KeyUp 18, 1
Delay x
End Sub

相关文档
最新文档