VB Script
[Professional and Corporate Editions Only]
You can use VB Script to generate all or parts of your message. To engage the script, use the Script macro. Below you can find more details:
Language name: VBScript
Distributor: Microsoft Corp.
Web site: http://msdn.microsoft.com/
Installation: VB Script is a part of Internet Explorer and is automatically installed on most Windows computers.
Known issues:
You cannot declare subs and functions inside the script
Visual basic can change the capitalization of names. Therefore you cannot use variables that differ from built-in names only by case. For example, the following script
dim SeqN
SeqN = document.seqn
will cause the error Object doesn't support this property or method: 'document.SeqN' because VB Script changed the capitalization to match the variable that you defined. To avoid the error, you need either to match the capitalization
dim seqn
seqn = document.seqn
or name the variable differently
dim SequenceNumber
SequenceNumber = document.seqn
Any variables set during the script execution are forgotten as soon as the script ends. When the script is executed for the next recipient these variables are unassigned.
Sample script: This script assumes that the recipient list has data fields Hours and Supervisor and composes a short text based on the values found in these fields.
set hours = recipient.item("Hours")
if hours.unknown then
worked = 0
else
worked = hours.value
end if
hoursleft = 10 - worked
if hoursleft <= 0 then
document.skip
else
document.write(recipient.item("Supervisor").text)
document.write(" reports that you ")
if worked = 0 then
document.write(" have not worked on your assignment. ")
else
document.write("only worked for ")
if worked = 1 then
document.write(" one hour. ")
else
document.write(worked & " hours. ")
end if
end if
document.write("You need ")
if hoursleft = 1 then
document.write(" one more hour. ")
else
document.write(hoursleft & " more hours. ")
end if
end if
|