+ Reply to Thread
Results 1 to 2 of 2

Using a Macro to send data to shared Outlook Calendars

Hybrid View

  1. #1
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Using a Macro to send data to shared Outlook Calendars

    You can use the Namespace.GetSharedDefaultFolder method to access the Calendar folder in another Exchange mailbox - as long as you, or more to the point, the current user has permissions (in Outlook) to do so.

    Code snippet - this temporarily creates an email message so it can resolve the addressee to get the correct calendar

        strName = "DoeJ"
         
        Set oApp = CreateObject("Outlook.Application")
        Set oNS = objApp.GetNamespace("MAPI")
        Set oDummy = objApp.CreateItem(olMailItem)
        Set oRecip = oDummy.Recipients.Add(strName)
        oRecip.Resolve
        If oRecip.Resolved Then
            On Error Resume Next
            Set oFolder = _
              oNS.GetSharedDefaultFolder(oRecip, _
                olFolderCalendar)
            If Not oFolder Is Nothing Then
                Set oAppt = objFolder.Items.Add
                If Not oAppt Is Nothing Then
                    With oAppt
                        .Subject = "Test"
                        .Start = Date + 7
                        .AllDayEvent = True
                        .Save
                    End With
    Partial code only to illustrate the idea, that will not compile.
    Last edited by cytop; 02-21-2017 at 10:43 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Help with VB code to send Outlook Meeting Request from Shared Calendar via excel
    By rv02 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-06-2017, 09:50 AM
  2. Replies: 1
    Last Post: 02-06-2017, 09:50 AM
  3. Replies: 1
    Last Post: 02-06-2017, 09:50 AM
  4. Replies: 0
    Last Post: 02-06-2017, 07:47 AM
  5. Import data from Outlook shared calendars
    By colombiano254 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-22-2015, 04:08 AM
  6. Create MsgBox When Shared Calendars Opened
    By races23 in forum Outlook Programming / VBA / Macros
    Replies: 0
    Last Post: 04-15-2013, 04:35 PM
  7. Exporting Excel data into Outlook calendars: Changing an Outlook VBA to Excel VBA
    By spaceporker in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-19-2012, 11:39 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1