View Single Post
  #3  
Old September 6th 07, 10:16 PM posted to microsoft.public.outlook.program_vba
joshnya2
external usenet poster
 
Posts: 5
Default Program not working for public account in Outlook.

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

Ads