Google 網路論壇不再支援新的 Usenet 貼文或訂閱項目,但過往內容仍可供查看。

Detect the existence of a particular ActiveX on the client's browser in IE5

瀏覽次數:27 次
跳到第一則未讀訊息

P.T.Gowadia

未讀,
2002年1月30日 凌晨4:32:322002/1/30
收件者:
I need to detect the existence of a particular ActiveX (Microsoft
Office Web Components) on the clients browser.ALl the clients use IE5
or IE5.5.
Can anyone direct me to the relevant objects/methods/properties?Or if
there is a pre-existing library, direct me to it?
Thanks in advance for your help.
P.T.Gowadia

Dan

未讀,
2002年2月3日 下午1:39:302002/2/3
收件者:
Perhaps you could create a variable objAX to represent the active x
component and test
(typeof(objAX) == "object") perhaps within a try and catch?

"P.T.Gowadia" <gow...@operamail.com> wrote in message
news:9dac1967.0201...@posting.google.com...

P.T.Gowadia

未讀,
2002年2月4日 凌晨1:06:092002/2/4
收件者:
"Dan" <dfoxm...@hotmail.com> wrote in message news:<Tsf78.2157$vd4.3...@news11-gui.server.ntli.net>...

> Perhaps you could create a variable objAX to represent the active x
> component and test
> (typeof(objAX) == "object") perhaps within a try and catch?
Can you please explain further as I don't know much about handling
Objects in Javscript.In particular, can you give some code
(explanatory).
Thank you for the help already given.
P.T.Gowadia

Holden Caulfield

未讀,
2002年2月4日 中午12:51:142002/2/4
收件者:
Hi there -- here is a fragmnt of code I used to do the same thing
awhile ago...

<SCRIPT LANGUAGE="VBSCRIPT" TYPE="TEXT/VBSCRIPT">
Function DetectObject(activeXname)
on error resume next
FoundStatus = False
FoundStatus = IsObject(CreateObject(activeXname))
If (err) then
FoundStatus = False
End If
DetectObject = FoundStatus
End Function
PluginStatus = DetectObject("ShockwaveFlash.ShockwaveFlash.5")
</SCRIPT>
<SCRIPT LANGUAGE="JAVASCRIPT" TYPE="TEXT/JAVASCRIPT">
alert("Flash 5 present: " + PluginStatus)
</SCRIPT>

Since you are using IE only, you can use vbscript. Essentially, you
try to create an object based on a string you've passed it... If it is
created, it means it exists, if not, it doesn't. The key is knowing
what string to use to test if the object is create-able. The one I
use here tests for Flash 5.

I don't know what you are looking for, but it may be necessary to find
a suitable string in the WIndows Registry. I have gone through the
registry hunting down obscure "signatures" before, and it has worked.

Hope this helps,

H.C.

P.T.Gowadia

未讀,
2002年2月6日 清晨6:34:542002/2/6
收件者:
Thanks for the help.I got it spot on.The code that I tried was:-

<SCRIPT LANGUAGE="VBSCRIPT" TYPE="TEXT/VBSCRIPT">
Function DetectObject(activeXname)
on error resume next

FoundStatus = null


FoundStatus = IsObject(CreateObject(activeXname))
If (err) then
FoundStatus = False

else
FoundStatus = True


End If
DetectObject = FoundStatus
End Function

</SCRIPT>


<SCRIPT LANGUAGE="VBSCRIPT" TYPE="TEXT/VBSCRIPT">

PluginStatus = DetectObject("owc.spreadsheet")
</SCRIPT>

I looked up some references at msdn.microsoft.com and found out that
the revelant activeXname was "owc.spreadsheet".
Thanks a bunch.
P.T.Gowadia

comman...@hotmail.com (Holden Caulfield) wrote in message news:<6d0ce83a.02020...@posting.google.com>...

0 則新訊息