按键精灵 如何创建以时间为名的word
path="C:\a.doc"//打开Word文档,为了演示,将第二个参数(可选参数)设为1使其可见,默认为不可见Call Plugin.lxj_Office.lxj_WordOpen(path,1)word=Plugin.lxj_Office.lxj_WordReadEX()Call Plugin.File.WriteFileEx("C:\b.txt", word)MessageBox "Word全文为:"&wordText = Plugin.File.ReadFileEx(".\QMScript\插件命令\命令例子:办公文档Office插件.Q")Text=replace(Text,"|",chr(10))Text=left(Text,len(Text)-1)Call Plugin.lxj_Office.lxj_WordWriteEX(Text)MessageBox "全文重写完毕"Call Plugin.lxj_Office.lxj_WordSet("段",0)MessageBox "已跳转至开头"Call Plugin.lxj_Office.lxj_WordSet("段",8,"下")MessageBox "已跳转至第9段开头"Call Plugin.lxj_Office.lxj_WordSet("字",8,"右",1)Call Plugin.lxj_Office.lxj_WordBackspace()MessageBox "已删除开头8个字符"Call Plugin.lxj_Office.lxj_WordSet("字",-1,"", 1)word=Plugin.lxj_Office.lxj_WordRead()MessageBox "选中文字为:"&wordCall Plugin.lxj_Office.lxj_WordWrite("测试")MessageBox "已写入新文字"Call Plugin.lxj_Office.lxj_WordInsertPage()MessageBox "已插入新页"Call Plugin.lxj_Office.lxj_WordInsertPic("C:\图片.jpg")MessageBox "已插入图片"Call Plugin.lxj_Office.lxj_WordSet("段",-1)MessageBox "已到达到最后一段的开头"Call Plugin.lxj_Office.lxj_WordSet("字",-1)MessageBox "已到达最后"//加密Call Plugin.lxj_Office.lxj_WordProtect("打开","123")MessageBox "已设置打开密码为123"Call Plugin.lxj_Office.lxj_WordProtect("修改","456")MessageBox "已设置修改密码为456"//操作结束关闭Word文档Call Plugin.lxj_Office.lxj_WordClose()MessageBox "演示结束"懒人插件里有word文档编辑命令
如何让按键精灵自动输入文档内的文本
帮你写好啦,直接copy上去运行即可,表太谢我~=======================================//读取txtword = Plugin.File.ReadFileEx("C:\1.txt")//分割为行Dim hanghang = split(hang, "|")//循环打出每一行For i = 0 To UBound(hang)SayString hang(i)Delay 900KeyPress "Tab", 1Delay 500//暂停,任意键继续WaitKeyNext=======================================基本注释已经写好,还有不懂得追问我吧希望对你有帮助!
按键精灵调取word文件完成贷款合同替换
Hwnd = Plugin.Window.Find("LWJGL", 0) //这一句要根据你自己要搜索的窗口标题、类修改成窗口的句柄搜索条件userRect = Plugin.Window.GetClientRect(Hwnd) //x、y、w、h 得到窗口左上角xy和宽度高度(计量不包含外边框)appRect = Plugin.Window.GetWindowRect(Hwnd) //x1、y1、x2、y2 得到窗口左上角和右下角xy(计量包含外边框)tempArr = Split(userRect, "|") userX = Clng(tempArr(0)): userY = Clng(tempArr(1)) userW = Clng(tempArr(2)) : userH = Clng(tempArr(3))tempArr = Split(appRect, "|") appX1 = Clng(tempArr(0)): appY1 = Clng(tempArr(1)) appX2 = Clng(tempArr(2)) : appY2 = Clng(tempArr(3))窗口宽度 = appX2 - appX1窗口高度 = appY2 - appY1窗口x = appX1窗口y = appY1根据计算出的八个数据去做鼠标点击吧userXuserYuserWuserH窗口宽度窗口高度窗口x窗口y
怎么使用word中按钮?
在10里试了试,个人觉得不用编程,很难实现你的需求!不过,你看是否可以换成另一个“ToggleButton”控件,应该可以完成你的需求。
上图演示: 是要这个功能吗? 不过,这个功能也有问题,就是会出现一组题中两个选项可以同时选中。
或者你也可以换成多选按钮来完成。
如图:
转载请注明出处51数据库 » 按键精灵操作word