MoleDirect
Technical User
Greetings... Im having trouble getting a vbscript to add a calendar item to outlook.. the variable "whenwhen" actually equals out to a date, but is made of other variables like the following:
when you look at the value, it comes out to this example:
#8/6/2009 11:05 PM#
here is the code that adds the item:
Now, if I just change the value:
olEvent.Start = whenwhen
to
olEvent.Start = #8/6/2009 11:05 PM#
it works fine, even though they are both the same thing.. I need it to work using the value "whenwhen"
The error i get is:
Any ideas?
Code:
whenwhen = ("#" & whenday & " " & whentime & "#")
#8/6/2009 11:05 PM#
here is the code that adds the item:
Code:
olEvent.Start = whenwhen
olEvent.Subject = subject
olEvent.ReminderSet = True
olEvent.ReminderMinutesBeforeStart = 1
olEvent.Attachments.Add "C:\remtemp\RemedyTicket " & iklogname & ".ARTask", _
olByValue, 1, "Test"
olEvent.Save
Now, if I just change the value:
olEvent.Start = whenwhen
to
olEvent.Start = #8/6/2009 11:05 PM#
it works fine, even though they are both the same thing.. I need it to work using the value "whenwhen"
The error i get is:
Code:
Type Mismatch: Cannot coerce parameter value. Outlook cannot translate your string.
Code: 80020005
Source: Microsoft Office Outlook
Any ideas?