下面这段Macro代码加到word的vba 中,每15秒点击一次网页, Public Const WM_CLOSE = &H10 Public Const WM_QUIT = &H12 Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long Sub my() ActiveDocument.FollowHyperlink Address:="http://rds.cn.yahoo.com/_ylt=AsiTTeco4s3T.wdtmnW4tPBTVwx./SIG=1asfruuut/**http%3a//click.p4p.cn.yahoo.com/cc_im%3fp=%25BF%25C2%25C4%25E1%25BF%25A8%25C3%25C0%25C4%25DC%25B4%25EF%26a=191887425%26e=dXuELQXmH9uWxly3eUlo396LDStfD.1dDi8ULH9c78WLuULHC0Lcyxygr5QIT8OsDABpZQXpX7BvKIUSZYwjWE8ou7FVJ4vpMBhXH15dEGOK6FYrSFmiqFqrVzRRZmTesqGv6sjPlRvPw8TKVlK0qaZu9e9xQaSFkXcWr.233nMuLW.ZhsXxe316ni7FW2Jcho7lvlUwYVFTtJSJr37hmHqLhZhet-1M", _ NewWindow:=True Application.OnTime Now + TimeValue("00:00:15"), "you" End Sub Sub you() Handle = FindWindow("IEFrame", vbNullString) PostMessage Handle, WM_CLOSE, 0, 0 PostMessage Handle, WM_QUIT, 0, 0 'DoEvents Application.Run "my" End Sub
[此贴子已经被作者于2006-8-21 12:57:17编辑过] |