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!

Outlook Automation

Status
Not open for further replies.

w33mhz

MIS
May 22, 2007
529
US
I seem to be having issue running this. I have tested the script as a vbs file and works fine, but when trying to run in from with in my aspx page it doesn't seem to create the meeting in outlook.
This is the script
Code:
<script type="text/vbsrcipt">

Sub CommandButton1_click(location,startdate,enddate)
Dim objOL 
Dim objAppt 
Const olAppointmentItem = 1
Const olMeeting = 1
Const olFree = 0
Set objOL = CreateObject("Outlook.Application")
Set objAppt = objOL.CreateItem(olAppointmentItem)
objAppt.Start = startdate
objAppt.Start = enddate
objAppt.Location = location
objAppt.ReminderMinutesBeforeStart = 15
objAppt.BusyStatus = olFree
objAppt.Save()
Set objAppt = Nothing
Set objOL = Nothing
End Sub
</script>

and this is how I am calling the script

Code:
<input type="button" value="Outlook" onclick="vbscript:CommandButton1_click( '{string(@Resource)}','{string(ddwrt:FormatDateTime(string(@RERStartDate),1033,'MM/dd/yyyy HH:mm:ss'))}','{string(ddwrt:FormatDateTime(string(@REREndDate),1033,'MM/dd/yyyy HH:mm:ss'))}')"/>

I don't get an error which is making it rather frustrating it acts like it runs but yet doesn't create the meeting.

Windows Haiku:

Serious error.
All shortcuts have disappeared.
Screen. Mind. Both are blank.
 
from what you provided there is no asp.net or webforms objects involved with this markup. forum329 better suited for this.

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
faq732-7259
 
Well I have a 1071 line aspx page i am working with. I am not sure why VBScript forum would be best place for me, when the script does work and is not really my problem, my problem is calling it on the onclick event of the button. I can fun a msg box on the onclick event of the button with those parameters and it comes up fine.
Code:
<input type="button" value="Outlook" onclick="vbscript:msgbox('{string(ddwrt:FormatDateTime(string(@RERStartDate),1033,'MM/dd/yyyy HH:mm:ss'))}' + ' ' + '{string(@Resource)}' +  ' ' + '{string(ddwrt:FormatDateTime(string(@REREndDate),1033,'MM/dd/yyyy HH:mm:ss'))}')"/>

I am wondering if there is a different synatx I need to use for my origanal button.

Windows Haiku:

Serious error.
All shortcuts have disappeared.
Screen. Mind. Both are blank.
 
webforms and asp.net are server side frameworks. webforms can generate html, but it has no effect on the behavior of the html. that's controlled by the browser with javascript, css, DOM, etc.

the webform may generate the html which contains the vbscript, but it has no effect on if/how the vbscript works. for that you should ask in the vbscript or html forums.

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
faq732-7259
 
well I figured it out, there was a simple misspelling error on the script tag and the @Resoure didn't like being passed to the string() function. Thx anyways

Windows Haiku:

Serious error.
All shortcuts have disappeared.
Screen. Mind. Both are blank.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top