Results 1 to 7 of 7
  1. #1
    4 Star Lounger
    Join Date
    Mar 2005
    Location
    Leicestershire, United Kingdom
    Posts
    506
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Creating Appointment item to Different Calendars (2000)

    Hi,

    Look to create appointment items to different cleandar folders within Outlook.

    I already have code to create an appointment item:

    "

    Dim objout As Outlook.Application
    Dim objcal As Outlook.AppointmentItem
    Dim strSubject As String
    Dim strMessage As String

    Set objout = New Outlook.Application
    Set objcal = objout.CreateItem(olAppointmentItem)

    On Error Resume Next

    strSubject = VHouseNo & " " & VStreetName & ", " & VArea & ", " & VCity & " - " & IIf([Surname2] = [Surname1], [Title1] & " and " & [Title2] & " " & [Surname1], [Title1] & " " & [Surname1] & IIf(IsNull([Surname2]), "", " and " & [Title2] & " " & [Surname2]))
    strMessage = "Home - " & [HomeTel] & vbCrLf & "Work - " & [WorkTel] & vbCrLf & "Mobile - " & [MobileTel]


    objcal.Body = strMessage
    objcal.Subject = strSubject
    objcal.Display

    'MsgBox "Appointment Set Please complete in taskbar."

    Set objout = Nothing
    Set objcal = Nothing

    On Error Resume Next
    AppActivate strSubject & " - Appointment", True 'Let Access complete then show"

    How can I say put this into a different calendar folder?
    Best Regards,

    Luke

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Creating Appointment item to Different Calendars (2000)

    Instead of using objout.CreateItem, you should use the Items.Add method of the calendar folder:

    Dim nsp As Outlook.NameSpace
    Dim fld As Outlook.MAPIFolder
    Set nsp = objout.GetNameSpace("MAPI")
    Set fld = nsp.GetDefaultFolder(olFolderInbox).Parent.Folders ("Other Calendar")
    Set objcal = fld.Items.Add
    ...

  3. #3
    4 Star Lounger
    Join Date
    Mar 2005
    Location
    Leicestershire, United Kingdom
    Posts
    506
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Creating Appointment item to Different Calendars (2000)

    I have tried to do this, but on:

    "Set nsp = objout.GetNamespace("MAPI")" I get the attached error message.

    Any ideas?
    Attached Images Attached Images
    Best Regards,

    Luke

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Creating Appointment item to Different Calendars (2000)

    This should come after the line

    Set objout = New Outlook.Application

  5. #5
    4 Star Lounger
    Join Date
    Mar 2005
    Location
    Leicestershire, United Kingdom
    Posts
    506
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Creating Appointment item to Different Calendars (2000)

    Is there a way that I can use VBA in access to verify if that slot is available for when booking an appointment?

    Can I retrieve information to determine the result?
    Best Regards,

    Luke

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Creating Appointment item to Different Calendars (2000)

    I've moved this thread to the Outlook forum since your questions have nothing to do with Access.

    To check for availability, you'd have to use the Find or Restrict methods to determine if there are appointments whose start is before the proposed end of the new appointment and whose end is after the start of the proposed appointment. This can become quite hairy because of Outlook's bizarre way of handling this. See Using the Find and Restrict methods to search for dates for some details.

  7. #7
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Creating Appointment item to Different Calendars (2000)

    See also this technique using Exchange Free/Busy information. (At least I assume it requires that all Recipients be on Exchange Server, I don't think you can get Free/Busy info. without Exchange Server.)

    One day I'll have to figure out how it works!
    -John ... I float in liquid gardens
    UTC -7ąDS

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •