Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

call activeX objects methods in vbscript

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
Hello,

Here is the reason of my concern :

I've written an activeX control that I've registered using the "regsvr32" DOS command. Then I've included this control in an html page thanks to "ActiveX Control Pad". When I launch the html page, the activeX object displays properly and reacts correctly on the events for which I have written code in Visual Basic ( Private Sub Button1_Click() for example ). THE PROBLEM IS that there are some public procedures/functions of the ActiveX object that I would like to call in the vbscript section of my html page. When I launch the script wizard in the activeX control pad, I can see the public variables and procedures or functions of my ActiveX control. Those I want to call are indeed among them ... but I don't succeed in calling them !
This is what the source of my html page looks like :
<HTML>
<HEAD>
<SCRIPT LANGUAGE=&quot;VBScript&quot;>
<!--
Sub window_onLoad()
call UserControl1.setMail(&quot;blablabla&quot;)
MsgBox &quot;test&quot;
end sub
-->
</SCRIPT>
<TITLE>New Page</TITLE>
</HEAD>
<BODY>
<OBJECT ID=&quot;UserControl11&quot; WIDTH=320 HEIGHT=240
CLASSID=&quot;CLSID:9EC1F059-6E9C-4803-A0AF-942EB4A0271D&quot;>
<PARAM NAME=&quot;_ExtentX&quot; VALUE=&quot;8467&quot;>
<PARAM NAME=&quot;_ExtentY&quot; VALUE=&quot;6350&quot;>
</OBJECT>
</BODY>
</HTML>

The line of code that bothers me is :
call UserControl1.setMail(&quot;blablabla&quot;)
where &quot;setMail&quot; is the name of a public procedure of my ActiveX object.

This line doesn't do what it is supposed to !
( It doesn't do anything actually ).
Also, because of this line, the following vbscript lines seem not to be executed.

Thanks for helping ...

Benjamin.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top