Results 1 to 4 of 4
  1. #1
    avarusbrightfyre is offline Advanced Beginner
    Windows Vista Access 2010 32bit
    Join Date
    Sep 2009
    Posts
    60

    Access to Outlook Exchange Calendar

    I have an access database that tracks information for commitments that our organization will participate in. It includes a lot of information that needs to be re-entered into our Outlook calendars (which is non-negotiable, because the leaders are addicted to them) that are stored on an exchange server. This calendar has custom forms for the entries that store different types of information (logistics tab, contact info tab, etc). What I want is the ability to send the information that we're already entering in access to the corresponding calendar entry.



    Now it seems logical to me that this isn't possible to find a specific calendar entry automatically and have it update with the desired info and I know there is a way to programmatically create a calendar entry on my local calendar (I've seen the code from looking around, but none of it works for exchange calendars, and I can't figure out the path). This being said, is there a way to create a new calendar entry, complete with the custom tab info, on an exchange calendar using automation? I am an owner for the calendar in question, if that helps.

    I'm fairly ok with VBA code and I'm fairly sure this will require a bunch of it. Thanks in advance,

    Dave

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Google: vba exchange calendar
    I did not explore them but this thread has two links that posters offer as solution.
    http://answers.microsoft.com/en-us/o...6-fea154b4286e
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    avarusbrightfyre is offline Advanced Beginner
    Windows Vista Access 2010 32bit
    Join Date
    Sep 2009
    Posts
    60
    Ok, so I followed the link and copied the code, as well as the GetFolder() method that the author suggested for accessing a public folder and modified the code for my use, but it doesn't seem to be working. I posted the code on the forum there, but no one seems to be answering and I figured I'd try here. Here is my code:

    Private Sub Command752_Click() <<<<<For actually making the calendar entry

    Dim objApp As Outlook.Application
    Dim objNS As Outlook.NameSpace
    Dim objFolder As Outlook.MAPIFolder
    Dim objDummy As Outlook.MailItem
    Dim objRecip As Outlook.Recipient
    Dim objAppt As Outlook.AppointmentItem
    Dim strMsg As String
    Dim strName As String

    On Error Resume Next
    ' ### name of person whose Calendar you want to use ###
    strName = "Calendar"
    Set objApp = CreateObject("Outlook.Application")
    Set objNS = objApp.GetNamespace("MAPI")
    Set objDummy = objApp.CreateItem(olMailItem)
    Set objRecip = objDummy.Recipients.Add(strName)
    objRecip.Resolve
    If objRecip.Resolved Then

    On Error Resume Next
    Set objFolder = GetFolder("Public Folders/All Public Folders/Subfolder/Subfolder/Subfolder/Subfolder/Calendar Name")
    If Not objFolder Is Nothing Then
    Set objAppt = objFolder.Items.Add
    If Not objAppt Is Nothing Then
    With objAppt
    .Subject = "Test Appointment"
    .Start = Date
    .AllDayEvent = True
    .Save
    End With
    End If
    End If
    Else
    MsgBox "Could not find " & Chr(34) & strName & Chr(34), , "User not found"
    End If

    Set objApp = Nothing
    Set objNS = Nothing
    Set objFolder = Nothing
    Set objDummy = Nothing
    Set objRecip = Nothing
    Set objAppt = Nothing

    End Sub
    __________________________________________________ _______________________________

    The following is just the "Getfolder" function from another page on the forum. Seems to work when I'm using it in the code above:

    Public Function GetFolder(strFolderPath As String) As MAPIFolder
    ' strFolderPath needs to be something like
    ' "Public Folders\All Public Folders\Company\Sales" or
    ' "Personal Folders\Inbox\My Folder"

    Dim objApp As Outlook.Application
    Dim objNS As Outlook.NameSpace
    Dim colFolders As Outlook.Folders
    Dim objFolder As Outlook.MAPIFolder
    Dim arrFolders() As String
    Dim I As Long
    On Error Resume Next

    strFolderPath = Replace(strFolderPath, "/", "\")
    arrFolders() = Split(strFolderPath, "\")
    Set objApp = Application
    Set objNS = objApp.GetNamespace("MAPI")
    Set objFolder = objNS.Folders.Item(arrFolders(0))
    If Not objFolder Is Nothing Then
    For I = 1 To UBound(arrFolders)
    Set colFolders = objFolder.Folders
    Set objFolder = Nothing
    Set objFolder = colFolders.Item(arrFolders(I))
    If objFolder Is Nothing Then
    Exit For
    End If
    Next
    End If

    Set GetFolder = objFolder
    Set colFolders = Nothing
    Set objNS = Nothing
    Set objApp = Nothing
    End Function

    Does anyone see anything in this code that would cause the process to fail? I get no error messages when I run the code, but the appointment doesn't show up on any of my calendars.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    I don't know anything about 'exchange server' or 'exchange calendar' so can't really test code.

    Have you step debugged?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. VBA Code for Mail Merge via Dynamic Data Exchange
    By Ganymede in forum Programming
    Replies: 2
    Last Post: 12-28-2011, 05:20 PM
  2. Assigning Outlook task from shared Outlook mailbox
    By Remster in forum Programming
    Replies: 2
    Last Post: 11-16-2011, 04:38 AM
  3. calendar on access
    By biagio in forum Access
    Replies: 1
    Last Post: 11-11-2011, 10:51 AM
  4. Exchange calendar appointments
    By avarusbrightfyre in forum Import/Export Data
    Replies: 1
    Last Post: 10-31-2011, 12:15 PM
  5. Export Access reports/query results to Outlook Calendar/Task
    By kfinpgh in forum Import/Export Data
    Replies: 0
    Last Post: 02-22-2007, 01:09 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums