I realize this is a pretty narrow problem so I apologize in advance, but if this is some type of bug then I want to report it. Even so, nearly all people will not be affected by it.
So...
I want to look for a schedule conflict for an Outlook resource, in my case a conference room, before I send an Outlook meeting invitation. I pass in the start and end times and look at the shared folder for any overlapping appointments.
The following code is only half way there, but I get an "10090 ActiveX Automation Error" when I make the call to the Outlook COM function GetSharedDefaultFolder. THIS CODE WORKS FINE IN VBA so I'm really confused. Plus, I have looked everywhere and cannot find a list of error codes this corelates to. Is it from Outlook or the Neowise BASIC plugin? I don't know.
Dim OLns As NameSpace
Dim OLapp As Outlook.Application
Dim myFolder As MAPIFolder
Dim myItems As Items
Dim myAppointment As AppointmentItem
Dim myRecipient As Recipient
Dim startdate As String
Dim enddate As String
Dim result As String
Dim n As Integer
Dim res As Boolean
Dim myFolders As Folders
Dim myObject As Object
startdate = "1/6/05 09:00"
enddate = "1/6/05 18:00"
Set OLapp = CreateObject( "Outlook.Application")
Set OLns = OLapp.GetNamespace("MAPI")
Set myRecipient = OLns.CreateRecipient("_7th Floor Conf") 'Change you resource you have
myRecipient.Resolve
res = myRecipient.Resolved
Set myFolder = OLns.GetSharedDefaultFolder( myRecipient,olFolderCalendar)
'The regular local call works fine.
'Set myFolder = OLns.GetDefaultFolder(olFolderCalendar)
Set myItems = myFolder.Items
myItems.Sort "[Start]", False
myItems.IncludeRecurrences = True
Set myItems = myItems.Restrict("[Start] > '" & startdate & "' AND [Start] < '" & enddate & "'")
myItems.IncludeRecurrences = True
Set myAppointment = myItems.GetFirst
Do Until myAppointment Is Nothing
result = result & myAppointment.Organizer & " "
Set myAppointment = myItems.GetNext
Loop
GetSharedDefaultFolder call from BASIC
GetSharedDefaultFolder call from BASIC
Last edited by ahunkins on Thu Jan 06, 2005 7:12 pm, edited 1 time in total.
GetSharedDefaultFolder call from BASIC
The best I can figure out is that this is a security issue with Exchange. So I think there is no bug in RoboTask or the BASIC plug-in.
I think to get around this, you have to lower the administrative security settings for Exchange to allow requests from a COM add-in. This is not practical for me and likely not for others either.
Oh well.
I think to get around this, you have to lower the administrative security settings for Exchange to allow requests from a COM add-in. This is not practical for me and likely not for others either.
Oh well.