For some reason I think you are loading another mailbox in your Outlook
profile and trying to programmatically create an Appointment item in the
Calendar stored in that mailbox. In those cases, you need to get that folder
by using the GetDefaultSharedFolder method and use the Items.Add method to
create a new item in that folder.
But - if you aren't doing that - the only thing I can think of is that you
don't have permissions on that Calendar. Can you create items there manually?
--
Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog:
http://blogs.officezealot.com/legault/
"joshnya2" wrote:
By public I mean it is a dummy Outlook account that is used as a
"centralized" calendar for team tasks/schedules. There are 10 people
with full access to this account. My program places an appointment on
the default calendar then sends invites to certain people based upon
what was entered in my custom form. If I have *MY* account/calendar up
the program works perfectly. If I create a profile and log into
Outlook as the *other* account the program halts on the line of code I
indicated.
My code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim StartTime As ValueType
Dim EndTime As ValueType
StartTime = DateTimePicker1.Value
EndTime = DateTimePicker1.Value.AddHours(9)
Dim objOL 'As Outlook.Application
Dim objAppt 'As Outlook.AppointmentItem
Const olAppointmentItem = 1
Const olMeeting = 1
objOL = CreateObject("Outlook.Application")
objAppt = objOL.CreateItem(olAppointmentItem)
'If ListBox1.SelectedItem = ("") Then
' MsgBox("Please select a team member for Remedy RC Bucket,
Thanks.")
'ElseIf ListBox2.SelectedItem = ("") Then
' MsgBox("Please select a team member for Inbox, Thanks.")
'ElseIf ListBox3.SelectedItem = ("") Then
' MsgBox("Please select a team member for Remedy IS/MIIS
Buckets, Thanks.")
'ElseIf ListBox4.SelectedItem = ("") Then
' MsgBox("Please select a team member for Triage, Thanks.")
'Else
Dim Counter As Integer
Counter = 0
'shortName(ListBox5)
'With objAppt
' .Subject = (Label9.Text)
' .start = StartTime
' .End = DateTimePicker1.Value.AddDays(5)
' .Location = displayName
' .AllDayEvent = True
' ' make it a meeting request
' .MeetingStatus = olMeeting
' .RequiredAttendees = ListBox5.Text
' .Send()
'End With
'Do While Counter 2
'This is the appointment for the first task
shortName(ListBox1)
With objAppt
.Subject = (Label1.Text)
.start = StartTime
.End = EndTime
.Location = displayName
'.AllDayEvent = True
' make it a meeting request
.MeetingStatus = olMeeting
.RequiredAttendees = ListBox1.Text
.Send()
End With
Thanks for any time/effort spent on my behalf. This was my first time
working with VBScript and it's been interesting to say the least 