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

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
 
M

masani 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
 
M

masani paresh

This is done. I have to unload my userform before displaying the appointment
form.

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top