Hi. I've been using this website as a guide for a number of problems and it has proved extremely useful. I'm currently trying to make it so that the user can click on a button and automatically have what they've entered added into their outlook calendar. It all works fine until I start trying to reference the fields on the form. This is what I have currently
Sub CTRL237_5_OnClick(eventObj)
Dim objOutlook
Dim itmAppt
Dim subj
Dim datenode
Set objOutlook = CreateObject("Outlook.Application")
Set itmAppt = objOutlook.CreateItem(1)
subj = InputBox("Please enter a subject")
if subj = "" then exit sub
set datenode = XDocument.DOM.selectSingleNode("/my:myFields/my:hirecarstartdate")
itmAppt.Subject = subj
itmAppt.Start = datenode.text
itmAppt.Duration = 60 itmAppt.
AllDayEvent = False
itmAppt.ReminderSet = True
itmAppt.ReminderMinutesBeforeStart = 30
itmAppt.Save
When I try to run that I get the following error.
Object required: 'datenode'
File:script.vbs
Line:38
When I remove the .text from the end of Line38 I get this:
The following error occurred:
Type Mismatch: Unable to coerce parameter value. Outlook cannot translate your string.
File:script.vbs
Line:38
Type mismatch.
Can anyone help me? I'm close to pulling my hair out and just making the user fill out the fields as well as an input box!