Solved

How to show "Month" and date in Title - HTA Script

Posted on 2015-01-30
4
305 Views
Last Modified: 2015-02-02
Hi Guys,

Can anybody help me out to modify HTA script code so the current date (month with date) auto update in the title of popup window?

Here is the beginning of HTA script code....

<head>

<title>Subject: IS Alert: Scheduled Maintenance: Friday, January 2 at 6:00 PM to Saturday January 3 at 1:00AM

</title> <body background = "background.jpg">
<HTA:APPLICATION APPLICATIONNAME="NetworkGroup" SCROLL="NO" SINGLEINSTANCE="yes" WINDOWSTATE="normal" SYSMENU="no">
0
Comment
Question by:Szuromi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 40580697
I don't think that you can do that.  I can only get VBscript to 'write' in the <body> and not in the <head> section.
0
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 40581090
I spoke too soon.  I had something out of order.  This demo shows how to do it.
<HTML>
<HEAD>
<HTA:APPLICATION ID="HelloExample" 
   BORDER="thick" 
   BORDERSTYLE="complex"/>
<SCRIPT LANGUAGE="VBScript">
DIM Mydate
Mydate = Date
DIM Mdays 
Mdays = Array("Surfin' Sunday","Moody Monday","Too Much Tuesday","Wild Wednesday","Thrilling Thursday","Finally Friday","Shopping Saturday")
DIM Mmonth
Mmonth = Array("Jan","Feb","Mar","Apr","May","June","July","Aug","Sept","Oct","Nov","Dec")
</SCRIPT>

<SCRIPT LANGUAGE="VBScript">
Document.Write "<TITLE>HTA - Hello World " & Mdays(Weekday(Mydate)-1) & "</TITLE>"
</script>

</HEAD>
<BODY>
<H2>HTA - Hello World</H2>
<SCRIPT LANGUAGE="VBScript">
Document.Write Mdays(Weekday(Mydate)-1)
</script>

</BODY>
</HTML>

Open in new window

0
 

Author Closing Comment

by:Szuromi
ID: 40584514
Hi Dave,

It is excellent.

Thank you very much!

Emese
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 40584536
You're welcome, glad to help.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question