Welcome to Bucaro TecHelp!

Bucaro TecHelp
HTTPS Encryption not required because no account numbers or
personal information is ever requested or accepted by this site

About Bucaro TecHelp About BTH User Agreement User Agreement Privacy Policy Privacy Site Map Site Map Contact Bucaro TecHelp Contact RSS News Feeds News Feeds

Write Your Own VBScript HTA Text Editor

Visual Basic (VB) is a very popular programming language because it is easily understood by humans. VBScript in interpreted Visual Basic, in other words the code is executed on the fly one statement at a time rather than compiled before hand. In this article, I'll show you how to write your own text editor application.

HTA stands for HTML Application. Basically you design your application as a webpage. To develop your application you can use a text editor like windows Notepad. Your source code consists of HTML, Dynamic HTML, Cascading Style Sheets (CSS), scripting languages such as VBScript or JavaScript. The HTML is used to generate the user interface, and the scripting language is used for the program logic.

A regular HTML file restricted to the security level of the web browser. You can't read or write files to the user's computer. You can use HTML5's storage API to store data, and read and write cookies in the browser. But once you change the file extension to .hta, it executes as a "fully trusted" application. An HTA can write, edit and delete files and registry entries.

HTA Text Editor

How The HTA Text Editor Works

Because this application is designed for instructional purposes, I didn't design it with the conventional [File] drop-down menu. In order to show how menu items link to the code that performs each function, I just placed all the menu selections in the main menu. Another non-conventional action is when you [Open] an existing file, it does not not display the files contents, you have to click the [Read] menu item to display the files contents. That's so, for instructional purposes, I can keep the file loading code separate from the file contents displaying code.

I have not included the complexity of directory navigation, [New] creates a new text file in current folder (the same folder application resides in), [Open] Lists text files in current folder, [Write] writes edited text back to the same file.

The Preliminaries

In case you're not familiar with the basic structure of an HTML document, I'll give you a brief introduction here. An HTML document consists of tags that divide the document into two sections, the head and the body. These tags are shown below.

<!DOCTYPE html>
<html lang="en">



In the head section, that is between the <head> and </head> tags is where you place Cascading Style Sheets (CSS) code and your VBScript code. The head section is shown below.




<script language="VBScript">



RSS Feed RSS Feed

Follow Stephen Bucaro Follow @Stephen Bucaro

Fire HD
[Site User Agreement]  [Advertise on This site]  [Search This Site]  [Contact Form]
Copyrightę2001-2010 Bucaro TecHelp P.O.Box 18952 Fountain Hills, AZ 85269