Using vbscript along with html
Hello everyone ! I need help because I can't figure out how to put vbscript code into an html page.
What I'd like to do is a page with a button on it, and when this button is clicked, it activates a script that either modifies the inner html of the current page, or creates another html page on which I can write what I want.
I've tried to do the second option by writing a code that creates a new instance of the internetexplorer.application object, and then writes something in it's html, but sadly it doesn't work
Could someone help me, or send the link to a website that explains how to do that ? I have no experience of using vbscript along with html
Posted Jun 30, 2022, 2:16 PM UTC
You should use Vbscript with HTA (HTML Application)
Another thing can you give us more information about your Vbscript code, just post it
What I want to do is a basic text editing program, in which you can write, read and store text "files" (I do it as a challenge, I know vbscript is not the easiest way to do it), so my code is more than a hundred lines long, and I'm afraid if I send just a sample of it it won't be understandable.
And, since I use a internet explorer page as an UI and I want to trigger the action when I click a button on the page, I'm not sure an hta file is the suited solution. Maybe I should use javascript instead of vbscript to do it ?
Use HTA as suggested, instead of HTML. HTML will be forced to be opened with a web browser which doesn't have any or have very limited access to local system resources. e.g. scripts run in web browsers do not have access to local file system.
HTA support both JavaScript and VBScript. Either one or both can be used.
Yes, finally I think I'm going to do that, I just found out about the capabilities of the HTAs and I want to learn how to use them, they allow to do things that are completely incredible compared to what vbs alone can do