Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Embedded VBS on Web Page

Status
Not open for further replies.

jswidorski

Programmer
Aug 25, 2003
8
US
I am trying to run a VB script from a web page. This is the code I am trying to run, but it does not work. I get a goof error on line 1 character 17. Problem is line 1 is blank...

Outlook is loaded and this script works when I run it as a vbs.

Also, if there are any typos here it is because I shorted then text to readability.

Any thoughts on what I am doing wrong?

==========
<SCRIPT LANGUAGE=VBScript>
Sub generate_vCard()
Const olApptmentItem = 1

Set objOutlook = CreateObject("Outlook.Application")
Set objAppt = objOutlook.CreateItem(olApptmentItem)

objAppt.Start = #10/20/2006 11:00:00 AM#
objAppt.Duration = 60
objAppt.Subject = "Title Here"
objAppt.Body = "This is a Test"
objAppt.Location = ""
objAppt.ReminderMinutesBeforeStart = 15
objAppt.ReminderSet = True

objAppt.Save
End Sub
</SCRIPT>


==========
HTML
==========
<A href="vbscript:generate_vCard();">vCard</A>
 
Now I am getting an error that I can't create the activeX object for outlook.application.

I am on an nt authenticated server trying to run this client side. My company always has outlook up and running on their pcs.

Thanks in advance...John
 
[1] Rename your html page to .hta.
[2] The anchor could be scripted like this.
[tt]<A href="#" onclick="generate_vCard">vCard</A>[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top