Cannot embed VBScript In HTML Email In Outlook 2003

G

Guest

Hi,

System Details: Windows XP Professional SP2, Outlook 2003 SP1, IE6 SP2.

I have a Java appliaction that constructs a HTML Email and sends it to a
mail client. In the HTML Email I have embeded some VBSCRIPT which is called
via the ONCLICK event of an <A> tag. In the VBScript I create an XML document
then mail it via the Outlook API.

On Win2K and Outlook 2000 this worked fine but now, when I click the link in
Outlook 2003, nothing happens (no "Cannot Create ActiveX" messages either) !!!

I have tried putting the message into the Internet zone (with low security)
and the same occurred. I replaced my script with a simple message box call
and this never activates either. I've even tried the "One-off-form" registry
hack, again to no avail.

If I load the sent HTML into a browser it works OK so I am sure the syntax
is right.
Here is an example of the link and script...

<a style="cursor:hand;color:green;text-decoration:underline"
onclick="OpenNewMail('test','test')">OK</a>

<SCRIPT LANGUAGE="VBSCRIPT">

Sub OpenNewMail(strAddress, strSubjectLine)

MsgBox "In OpenNewMail"

End Sub

</SCRIPT>

Can anyone suggest how I can get vbscript to work in a HTML email in Outlook
2003 (has anyone got it to work!)? Is there some sort of new META setting
to make the HTML Outlook 2003 friendly perhaps?

Any help would be massively appreciated as this is driving me barmy!

Cheers
sanx
 
S

Sue Mosher [MVP-Outlook]

For security reasons, since May 2000 or so (post-Melissa), Outlook has not
run script code in HTML messages. You'll need to consider another approach.
 
G

Guest

Sue,

Thanks for your response.

I was under the impression that you could still run script but that you had
to run in the "Internet Zone". This is how it is described here
http://office.microsoft.com/en-gb/assistance/HA011018701033.aspx under the
section "HTML and RTF message security". Is this information erroneous?

In my solution I want to present the user with edit fields that they can
change and then send the changed values back to a mail server inbox which is
monitored by a Java program and processed accordingly. If I use a HTTP form
instead or a link to a web page then I have to involve a web server which I
do not want to do (due to end-customer expense/maintenance etc.). Is it
possible to send a form to a mail address? Can anyone suggest another way to
achieve this solution?

Many thanks
sanx
 
S

Sue Mosher [MVP-Outlook]

This behavior is not something you can control as the message sender. The
***user*** would have to choose to run your HTML message using the View |
View in Internet Zone setting in Outlook. (If that works at all. I haven't
tested in in OL2003 and would, frankly, be quite happy from a security point
of view if it didn't work.)I know a lot of Outlook users aren't real smart
about security, but most won't know about that option and should be
suspicious of any message that asks them to use it.

A web server/web form is a much better and more secure solution. If you're
concerned about expense, imagine the expense of a single malicious message
with rogue HTML code on it unleasing an infection that affects all the
machines in an office.
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top