- ©«¤l
- 37
- ¥DÃD
- 11
- ºëµØ
- 0
- ¿n¤À
- 87
- ÂI¦W
- 0
- §@·~¨t²Î
- window7
- ³nÅ骩¥»
- office 2003
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2011-3-14
- ³Ì«áµn¿ý
- 2022-5-30
|
[µo°Ý] ¶}±Ò web link ,¥Î OnMouseDown ©Î¨ä¥L¤èªk
½Ð¦U¦ì°ª¤â¤j¤jÀ°¦£¦p¤U:
¥Î VBA¶}±Ò¤@ºô¶«áµM«ánÂIÀ»¨ä ¤¤¤@Ólink¡A¥ý§Q¥Îgetelementsbytagname("a")¨ú±o©Ònªº¦ì¸m«á¡A¥Î. click¶}±Ò«o¨S¦³°Ê§@(¥¿±`ªº¸Ü³£·|¶}±Ò)¡AÀˬdHTML codeµo²{¨ä<a> ªº href code¸ò¥¿±`ªº¤£¤Ó¤@¼Ë¦p¤U¡A¤]¦h¤@Ó onmousedown ªºevent:
<a onmousedown="this.href=linkTo('/e/«á±¤£¤è«K¦C¥X')" href="about:" target="_blank"> ---©êºp¤£¤è«K¶K¥Xì©lcode
google¤@¤U¡A¦³µo²{Ãþ¦ü°ÝÃD»P¸Ñªk:
-------------------------------------------------------------------
°ÝÃD:
HTML Code:
<table id="table2" onmousedown="PressIt("Section2")" class="contextarea" border="0" cellspacing="0" cellpadding="0" style="height: 95px; width: 100%">
At first I thought this might be handled by using InvokeMember("click"), but that has no effect. If I try InvokeMember("onmousedown") I receive a javascript error on the page. Can anyone tell me if/how one invokes the onmousedown property of an object inside of the WebBrowser control?
As an FYI: I'm designing in 2008 and targeting .Net 2.0
¸Ñªk:
WebBrowser1.Document.All("table2").RaiseEvent("OnMouseDown")
--------------------------------------------------------------------------------
¦ü¥G¬O§Q¥ÎIJ°Ê " OnMouseDown" event¨Ó¶}±Ò¡C
¤£¤Ó²M·¡RaiseEvent»yªk¸Ó«ç»ò¼g¡A¸Õ¤F¥H¤Ucode³£¨S¥Î
Set wall = ifm.getElementsByTagName("a")
For Each w In wall
w.RaiseEvent("OnMouseDown") ---¨S°Ê§@
'w.OnMouseDown ---¨S°Ê§@
'w.OnMouseDown ---¨S°Ê§@
Next
½Ð°Ý¥ÎVBA¸Ó¦p¦óIJ°ÊOnMouseDown event ©Î¦³¨ä¥L¤è¦¡¥i¥H¶}±Ò¥H¤Ulink
<a onmousedown="this.href=linkTo('/e/«á±¤£¤è«K¦C¥X')" href="about:" target="_blank"> ---©êºp¤£¤è«K¶K¥Xì©lcode
°Ç°Çªø¡A·PÁÂÀ°¦£~~ |
|