hiding outlook macro of creating appointments RRS feed

  • Question

  • hello

    i wrote a macro witch creates appointments base on a UserForm.

    at the end of the creation i used:

    .Close   SaveChanges = True

    so the appointment windows closes automatically . but can i hide it altogether? 

    ive tried : 

    Application.ScreenUpdating = False

    but i got compile error that "object doesnt support by this property or method".

    i probably misplace it in my code, but i've tried many places.

    does any one know something about it?

    Friday, March 15, 2013 5:46 PM

All replies

  • What exactly are you trying to hide? The userform? If so unload it when you have finished with it.

    There should be no need to display the appointment 'window'. You can create an appointment without displaying any dialog using vba e.g. as follows which will create an appointment at the current time.

    Sub AddOutlookApptmnt()
    Dim objAppt As AppointmentItem
    Dim strDate As String
    Dim strTime As String
    Dim datOutlookDate As Date
        strDate = Format(Date, "dd/MM/yyyy")
        strTime = Format(Time, "HH:MM")
        datOutlookDate = CDate(strDate & " " & strTime)

        Set objAppt = CreateItem(1)
        With objAppt
            .Start = datOutlookDate
            .ReminderSet = False
            .AllDayEvent = True
            .Subject = "This is the subject"
            .Body = "This is the body text"
            .BusyStatus = 0
        End With

    Set objAppt = Nothing

    End Sub

    Graham Mayor - Word MVP

    Saturday, March 16, 2013 11:24 AM