VBscripting OL2000 client with .asp on iis5 ? Help needed..

B

Bob [BVP]

Trying to do what Ebay does with making links to add appointment with
reminder via html/asp page.. but with no luck.. The page executes
but nothing happens.. any advise would be appreciated.. Server vs Client
scripts ? Help appreciate..

<%@ Language=VBScript %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
<SCRIPT LANGUAGE=vbscript>
Dim olApp
Dim oAppt
Dim objRecip
Set olApp = GetObject(, "Outlook.Application")
Dim olNs
Set olNs = olApp.GetNamespace("MAPI")
Set oAppt = olApp.CreateItem(olAppointmentItem)
'Set meeting parameters

With oAppt
..Duration = 60 'lDuration '(in minutes)
..Location = "Here" 'sLocation
'.MeetingStatus = 0 'olMeeting - No, 0 = olNonMeeting
..MeetingStatus = 1 'olMeeting is value 1
..Start = "4/5/2004 17:22" 'dtStart
..End = "4/5/2004 17:59"
..Subject = "Test Subject" 'sSubject
..ReminderSet = True
..ReminderMinutesBeforeStart = 15 'lReminder '(in Minutes)
' Set objRecip = .Recipients.Add("Test, Name")
' objRecip.Type = olRequired
..save

End With

</SCRIPT>

<br>

<hr>

</BODY>

</HTML>
 
K

Ken Slovak - [MVP - Outlook]

If you are using the Outlook object model Outlook has to be installed and
using GetObject it would have to be already running and the code would have
to be running in the namespace where Outlook is running. If you set up your
script in debugging mode you can check on each line to see if you are
getting the objects you expect and where any errors are occurring.
 
B

Bob [BVP]

Thanks for advice.. I went into debugging mode.. found that indeed the vbscript
could not use Set oAppt = olApp.CreateItem(olAppointmentItem) but had to
be > > Set oAppt = olApp.CreateItem(1).. Whooo hoooo..
 
K

Ken Slovak - [MVP - Outlook]

VBScript doesn't have the Outlook enums defined so you can't use them but
have to use the actual values instead. It's the same thing with many
constants that you'd take for granted using Outlook VBA code.
 

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