Computer Learning Zone CLZ Access Excel Word Windows

However bad life may seem, there is always something you can do, and succeed at. While there's life, there is hope.

-Stephen Hawking
 
Home   Courses   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
 
Tips & Tricks

New Tips Added Weekly!
Click here to get on our Mailing List

   
 
HTA

Expert - Level 2

Useful Elements

Useful Elements

Autorun
	Sub Window_Onload
		Msgbox "The application has started."
	End Sub
	
Refresh
	Sub RunScript_Refresh
		Location.Reload(True)
	End Sub
	
Change the Cursor
	Sub RunScript_Cursor
		document.body.style.cursor = "wait"
	End Sub
	
Copy To Clipboard
	Sub RunScript_Copy
		strCopy = BasicTextArea.Value
		document.parentwindow.clipboardData.SetData "text", strCopy
	End Sub
	
Paste From Clipboard
	Sub RunScript_Paste
		DataArea.InnerHTML = document.parentwindow.clipboardData.GetData("text")
	End Sub
	
Disable
	Sub RunScript_Disable
		CONTROLID.Disabled = False
	End Sub
	
Confirmation Box
	Sub RunScript_Confirmation
		blnAnswer = window.confirm("Are you sure you want to continue?")
		If blnAnswer Then
			Msgbox "You clicked the OK button"
		Else
			Msgbox "You clicked the Cancel button."
		End If
	End Sub
	
Prompt
	Sub RunScript_Prompt
		strAnswer = window.prompt("Please enter the domain name.", "599CD.com")
		If IsNull(strAnswer) Then
			Msgbox "You clicked the Cancel button"
		Else
			Msgbox "You entered: " & strAnswer
		End If
	End Sub
	
Display Data in a different window
	Sub RunScript_IE
		Set objIE = CreateObject("InternetExplorer.Application")
		objIE.Navigate("about:blank")
		objIE.ToolBar = 0
		objIE.StatusBar = 0
		Set objDoc = objIE.Document.Body
		strHTML = "<B>This information is displayed in a separate window.</B>"
		objDoc.InnerHTML = strHTML
		objIE.Visible = True
	End Sub
	
Print
	Sub RunScript_Print
		Window.Print()
	End Sub
	
Save to .htm
	Sub RunScript_Save
		Set objFSO = CreateObject("Scripting.FileSystemObject")
		objFSO.CreateTextFile("test.htm")
		Set objFile = objFSO.OpenTextFile("test.htm", 2)
		objFile.WriteLine DataArea.InnerHTML
		objFile.Close
	End Sub
	
Timer
	Sub Window_OnLoad
		iTimerID = window.setInterval("RunScript", 5000, "VBScript")
	End Sub
	
Tooltip
	Sub RunScript_Tooltip
		Tooltip.Title = "You successfully changed the tooltip."
	End Sub
	
Quit
	Sub RunScript_Quit
		Window.Close
	End Sub
	

You can use these in combination to produce some dynamic results.


Sample Files
Various.hta


Previous Lesson: Expert Level 1 | Next Lesson: Expert Level 3

 

Alex Hedley (Avatar) By: Alex Hedley


Click here to sign up for more FREE tips

 

 

 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2023 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 12/8/2023 12:59:30 AM.