txt没试过,excel有插件,我写过的代码供参考:
Call Plugin.Office.OpenXls("C:\1.xls")
Dim i
Dim a()
ReDim a(7)
For s=10 to 189'读取excel第10到189行
For i=0 to 6'读取第1到7列,每个单元格的值依次放到a(i)数组里
Text = Plugin.Office.ReadXls(1, s, i+1)
a(i)=Text
Next
Delay 2000
'按Ctrl+N
KeyDown 17, 1
KeyPress 78, 1
KeyUp 17, 1
Delay 5500
'输入信息
SayString a(0)
Delay 200
KeyPress "Tab", 1
Delay 200
SayString a(1)
Delay 200
KeyPress "Tab", 1
Delay 200
SayString a(1)
Delay 200
KeyPress "Tab", 1
Delay 200
KeyPress "Up", 1
Delay 200
KeyPress "Tab", 3
Delay 200
KeyPress "Space", 1
Delay 1000
'按Ctrl+Tab
KeyDown 17, 1
KeyPress "Tab", 1
KeyUp 17, 1
Delay 1000
SayString a(2)'Full name
Delay 200
KeyPress "Tab", 1
Delay 200
SayString a(3)'description
Delay 200
KeyPress "Tab", 1
Delay 200
SayString a(4)'Phone Number
Delay 200
KeyPress "Tab", 1
Delay 200
SayString a(5)'E-mail
Delay 200
KeyPress "Tab", 1
Delay 200
SayString a(6)'Customer1
Delay 1000
'按Ctrl+Tab
KeyDown 17, 1
KeyPress "Tab", 1
KeyUp 17, 1
Delay 1000
KeyPress "Tab", 1
Delay 200
KeyPress "Space", 1
Delay 500
KeyPress "Enter", 1
Delay 2000
Next
//关闭Excel文档工作表
Call Plugin.Office.CloseXls()
MsgBox "共完成" & s & "组数据自动填写。"
按键精灵如楼上所述,这段代码你可以试试。但是,可以直接用另外的软件来实现。比如PageOperator,通过在设置栏导入txt,或者excel内容,实现自动输入到网页的功能。
BBdoc文档搜索工具支持word Excel pdf txt csv等各类文档内容快速搜索。