Open Appointment form from User Form code and add the attemdee ite

  • Thread starter Thread starter masani paresh
  • Start date Start date
M

masani paresh

Hi,

I have developed user form in VbaProject.OTM where I am fetching data from
database and storing into ListBox. When user select any item say XXX from
ListBox and click on Proceed button then I want to open new Appointment form
with XXX attendee. Could any one please help on this.

Thanks,
Paresh
 
Hi All,

I wrote below code on button click event. but it gives runtime error
'-36683771(fdd04005': "A dialog box is open. Close it and try again"

Any help ??

Private Sub CommandButton2_Click()
Dim confRoomName
If Not IsNull(ListBox1.Value) Then
'MsgBox "You have selected: " & ListBox1.Value
Dim olkNewAppt As Outlook.AppointmentItem
Set olkNewAppt = Application.CreateItem(olAppointmentItem)
With olkNewAppt
.Start = confStartTime
.End = confEndTime
.Location = ListBox1.Value
End With
olkNewAppt.Recipients.Add (ListBox1.Value)
olkNewAppt.Display
Else
MsgBox "Please select any conference room"
End If
End Sub
 
This is done. I have to unload my userform before displaying the appointment
form.

Thanks.
 
Back
Top