喜欢的话考去用用,不过先声明,对本程序造成的后果我不负责任哦。
'click
If Wscript.Arguments.Count=0 Then
Msgbox "This Version is extreme dangerous, and it maybe harmful to your computer."+ chr(13)+_
"Please make sure this vbs is in the same folder of your xml file.",48,"prompt"
Wscript.Quit
End If
'start
set wshell = CreateObject("Wscript.Shell")
'For i=0 to Wscript.Arguments.Count-1
singlePath=Wscript.Arguments(0)
'next
'start wordpad
with wshell
.Run "wordpad """ + singlePath + """"
Wscript.Sleep 1000
.SendKeys("%")
Wscript.Sleep 100
.SendKeys("f")
Wscript.Sleep 100
.SendKeys("a")
Wscript.Sleep 100
.SendKeys("{TAB}")
Wscript.Sleep 100
.SendKeys("{DOWN}")
Wscript.Sleep 100
.SendKeys("{UP}")
Wscript.Sleep 100
.SendKeys("{ENTER}")
Wscript.Sleep 100
.SendKeys("{ENTER}")
Wscript.Sleep 100
.SendKeys("%{F4}")
end with
Wscript.Sleep 1000
'START word
rtfpaths = split(singlePath,".")
rtfpath = rtfpaths(0)+".rtf"
with wshell
.Run "winword """ + rtfpath + """"
Wscript.Sleep 2000
'if you have no sadd..style plz del this module
.SendKeys("%{F8}")
Wscript.Sleep 100
.SendKeys("s")
Wscript.Sleep 100
.SendKeys("a")
Wscript.Sleep 100
.SendKeys("{DOWN}")
Wscript.Sleep 100
.SendKeys("{ENTER}")
Wscript.Sleep 100
'----------------------------
Wscript.Sleep 1000
.SendKeys("%")
Wscript.Sleep 100
.SendKeys("e")
Wscript.Sleep 100
.SendKeys("f")
enter_text("\<*\>")
Wscript.Sleep 100
.SendKeys("{TAB}")
Wscript.Sleep 100
.SendKeys(" ")
Wscript.Sleep 100
send_key_by_time "{TAB}",2
.SendKeys(" ")
Wscript.Sleep 100
send_key_by_time "{TAB}",4
.SendKeys(" ")
Wscript.Sleep 100
send_key_by_time "+{TAB}",2
.SendKeys(" ")
Wscript.Sleep 100
.SendKeys("%{F4}")
Wscript.Sleep 100
'set style
call_style
send_key_by_time "{DOWN}",6
.SendKeys("{ENTER}")
Wscript.Sleep 100
'------------------------here may not be use or should be modified---------------
send_key_by_time "{ESC}",4
send_word_search
' enter text
enter_text("text=""*""")
send_key_by_time "{TAB}",4
.SendKeys(" ")
Wscript.Sleep 100
.SendKeys("%{F4}")
Wscript.Sleep 100
' set style = clear
call_style
send_key_by_time "{UP}",6
.SendKeys("{ENTER}")
Wscript.Sleep 100
'seasrch text="
send_word_search
enter_text("text=""")
send_key_by_time "{TAB}",4
.SendKeys(" ")
Wscript.Sleep 100
.SendKeys("%{F4}")
Wscript.Sleep 100
call_style
send_key_by_time "{DOWN}",6
.SendKeys("{ENTER}")
Wscript.Sleep 100
'search "/>
send_word_search
enter_text("""/>")
send_key_by_time "{TAB}",6
send_key_by_time " ",1
send_key_by_time "+{TAB}",3
send_key_by_time " ",3
.SendKeys("%{F4}")
Wscript.Sleep 100
call_style
.SendKeys("{ENTER}")
Wscript.Sleep 100
' search &*;
send_word_search
enter_text("&*;")
send_key_by_time "{TAB}",7
send_key_by_time " ",1
send_key_by_time "+{TAB}",2
send_key_by_time " ",3
.SendKeys("%{F4}")
Wscript.Sleep 100
call_style
send_key_by_time "{DOWN}",1
.SendKeys("{ENTER}")
Wscript.Sleep 100
send_word_search
.SendKeys("+5") '%
enter_text("[0-9a-zA-Z]")
send_key_by_time "{TAB}",4
send_key_by_time " ",4
.SendKeys("%{F4}")
Wscript.Sleep 100
call_style
.SendKeys("{ENTER}")
Wscript.Sleep 100
'--------------------------END----------------------------------
Wscript.Sleep 1000
.SendKeys("%{F4}")
Wscript.Sleep 100
.SendKeys("y")
Wscript.Sleep 100
end with
' subs
sub call_style
set wshell = CreateObject("Wscript.Shell")
with wshell
.SendKeys("%")
Wscript.Sleep 100
.SendKeys("o")
Wscript.Sleep 100
.SendKeys("s")
Wscript.Sleep 100
end with
end sub
sub enter_text(textin)
set wshell = CreateObject("Wscript.Shell")
wshell.SendKeys(textin)
Wscript.Sleep 100
end sub
sub send_word_search
set wshell = CreateObject("Wscript.Shell")
wshell.SendKeys("^f")
Wscript.Sleep 100
end sub
sub send_key_by_time(keyname,times)
set wshell = CreateObject("Wscript.Shell")
for ic=0 to times-1
wshell.SendKeys(keyname)
Wscript.Sleep 100
next
end sub发表于 @ 2008年07月17日 16:53:00|评论(loading...)|编辑|收藏