none
Change default folder from My Calendar to Shared Calendar RRS feed

  • Question

  • How do I create a meeting that will be saved to a calendar other than the default My Calendar?

    Jill Marlow

    Wednesday, November 21, 2012 1:12 AM

All replies

  • grab that other folder and use .Items.Add to add new item there.
    Wednesday, November 21, 2012 9:23 AM
  • You would have to write code to do that. However, it's not really a good idea. Only if it's stored in the default Calendar folder will any updates or changes or attendance responses be tallied or updated to the item.

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "Jill Marlow" <=?utf-8?B?SmlsbCBNYXJsb3c=?=> wrote in message news:ee45e365-7feb-4fb0-a3ce-b459259c2cb4...
    How do I create a meeting that will be saved to a calendar other than the default My Calendar?

    Jill Marlow


    Ken Slovak MVP - Outlook
    Wednesday, November 21, 2012 2:46 PM
    Moderator
  • How do I "grab that other folder" programatically?

    Jill Marlow

    Wednesday, November 21, 2012 3:10 PM
  • I assumed I would have to write a program.  If that's not a good idea, then maybe you could tell me the best way to accomplish the following:  I am trying to help our church become better organized.  Currently, the secretary has a big paper calendar for managing events/meetings at the church.  Since they recently upgraded and networked the computers, I thought it would be better to create a new Outlook calendar on the secretary's computer, share it with the rest of the church staff, and use that to schedule events/meetings.  I was asked to create an event planner, which I have done in MS Access.  What I wanted to do is once the secretary/user inputs the subject, date, time, etc. on the Access form, he/she would click a button which would schedule the event/meeting automatically without manually switching to Outlook and re-entering all of the parameters.  I would want the event/meeting to be placed on the shared calendar rather than the secretary's personal calendar.  If possible, I would also like it to return a message if the suggested resource was busy during that time so that a different meeting room could be chosen.

    Thanks in advance for any assistance.


    Jill Marlow

    Wednesday, November 21, 2012 3:26 PM
  • As I mentioned, putting appointments/meetings in another calendar folder than the default isn't a good idea as they wouldn't get tallied in any way except in the default Calendar.
     
    How are things being networked? Is Exchange server involved? That would be best and easiest, just set up a mailbox that everyone can be a delegate on and hace the secretary be the mailbox owner. Other than that, some sort of synched calendar setup might be best.
     
    Resources in Outlook are generally also mailboxes, called resource mailboxes. That's how scheduling and free/busy are maintained.
     
    Certainly Outlook can be automated to have data from an Access form be posted into the Outlook Calendar (or any other folder). The question is whether that's the best soluton.
     
    What version of Outlook is being used, first of all? Is Exchange involved at all?

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "Jill Marlow" <=?utf-8?B?SmlsbCBNYXJsb3c=?=> wrote in message news:7d8739f5-a428-475f-a4d6-5d053e14642e...

    I assumed I would have to write a program.  If that's not a good idea, then maybe you could tell me the best way to accomplish the following:  I am trying to help our church become better organized.  Currently, the secretary has a big paper calendar for managing events/meetings at the church.  Since they recently upgraded and networked the computers, I thought it would be better to create a new Outlook calendar on the secretary's computer, share it with the rest of the church staff, and use that to schedule events/meetings.  I was asked to create an event planner, which I have done in MS Access.  What I wanted to do is once the secretary/user inputs the subject, date, time, etc. on the Access form, he/she would click a button which would schedule the event/meeting automatically without manually switching to Outlook and re-entering all of the parameters.  I would want the event/meeting to be placed on the shared calendar rather than the secretary's personal calendar.  If possible, I would also like it to return a message if the suggested resource was busy during that time so that a different meeting room could be chosen.

    Thanks in advance for any assistance.


    Jill Marlow


    Ken Slovak MVP - Outlook
    Wednesday, November 21, 2012 7:56 PM
    Moderator
  • Yes, Exchange Server is being used, and so is Outlook 2010.  You question whether importing the data from Access would be the best solution.  What, then, would be?  The reason I wanted to do it that way is so the secretary doesn't have to enter the information into the event planner, then go over to Outlook and enter essentially the same information there.  I thought if I could create the meeting programatically, it would save the secretary time and effort.

    I will check with the guy who set up the church's network/email to see if another mailbox can be added.


    Jill Marlow

    Wednesday, November 21, 2012 10:29 PM
  • You can create the meeting in Outlook using code, if it's necessary to also have the meeting in Access. That's up to you. I was pointing out that if any meetings are placed anywhere other than in the default calendar folder they will not be tallied or updated in any way by Outlook.
     
    I suggested a different mailbox with the user as owner of that also as a way to use a default calendar folder without interfering with her normal calendar. You can still get to that mailbox calendar using NameSpace.GetSharedDefaultFolder(recip) where "recip" is the Recipient object represented by the user. If that's what you want you can then use code to add or work with meetings in that calendar folder.

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "Jill Marlow" <=?utf-8?B?SmlsbCBNYXJsb3c=?=> wrote in message news:2aac499f-d086-4dc2-8be5-6977f25a9c1d...

    Yes, Exchange Server is being used, and so is Outlook 2010.  You question whether importing the data from Access would be the best solution.  What, then, would be?  The reason I wanted to do it that way is so the secretary doesn't have to enter the information into the event planner, then go over to Outlook and enter essentially the same information there.  I thought if I could create the meeting programatically, it would save the secretary time and effort.

    I will check with the guy who set up the church's network/email to see if another mailbox can be added.


    Jill Marlow


    Ken Slovak MVP - Outlook
    Monday, November 26, 2012 2:54 PM
    Moderator
  • I'm not sure what you mean by "Recipient object represented by the user".  I apologize for seeming ignorant.  I've written miles of code for Access, but this is the first time I've tried to write code for Outlook, so I'm still not familiar with some of the terminology.

    Here is the code that I have written behind a button on my Access form.  I tested it on my computer (I removed the .send command for the test).  It does everything I want except put it on another calendar.  I checked with the guy who set up the church's email system.  He said there is a mailbox called "Church Events" that was created for this purpose.  What line(s) would I insert and where in order to put this meeting on the "Church Events" mailbox/calendar?  Thanks.

    Private Sub cmdScheduleMeeting_Click()
    Dim dteDate As Date
    Dim dteStart As Date
    Dim dteEnd As Date
    Dim strLocation As String
    Dim strSubject As String
    Dim strInvitees As String
    Dim myOutlook As Outlook.Application
    Dim myMeeting As AppointmentItem
    Dim booOffsite As Boolean
    With Me
        dteDate = !EventDate
        dteStart = !StartTime
        dteEnd = !EndTime
        strLocation = EventLocation(!EventID) ' user-defined function
        strSubject = !Event
        strInvitees = MembersEmailsByMinistry(!MinistryID)  ' user-defined function
        booOffsite = !Offsite
    End With
    Set myOutlook = CreateObject("outlook.application")
    Set myMeeting = myOutlook.CreateItem(olAppointmentItem)
    With myMeeting
        If booOffsite = False Then
            .Resources = strLocation
        End If
        .MeetingStatus = olMeeting
        .RequiredAttendees = strInvitees
        .Subject = strSubject
        .Start = dteDate + dteStart
        .End = dteDate + dteEnd
        .ReminderMinutesBeforeStart = 15
        .Location = strLocation
        .Save
        .Send
    End With
    Set myMeeting = Nothing
    Set myOutlook = Nothing
    End Sub


    Jill Marlow

    Wednesday, November 28, 2012 8:19 PM
  • Sorry for the delay, I've been sick.
     
    You need the alias of the owner of that mailbox to create a Recipient object.
     
    That can be an Exchange alias or distinguished name or an SMTP address. For example, in my Exchange organization the administrator is my Yellow Lab, Casey. He can be referred to as "CaseyS" or as caseys at slovaktech.com.where "at" is replaced by "@". If I want to create a recipient for him I'd use code something like this:
     
    ' oApp = Outlook.Application
    Dim oNS As Outlook.NameSpace
    Set oNS = oApp.GetNameSpace("MAPI")
     
    Dim oRecip As Outlook.Recipient
    Set oRecip = oApp.CreateRecipient("caseys") ' or I could use his SMTP address, or even "Casey Slovak"
     
    Dim oFolder As Outlook.Folder
    Set oFolder = oNS.GetSharedDefaultFolder(oRecip, OlDefaultFolder.olFolderCalendar)
     
    That would return a Folder object which represents the default Calendar folder for the mailbox owned by Casey.

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "Jill Marlow" <=?utf-8?B?SmlsbCBNYXJsb3c=?=> wrote in message news:84c13562-d6b8-4480-9d34-6a2643d7886a...

    I'm not sure what you mean by "Recipient object represented by the user".  I apologize for seeming ignorant.  I've written miles of code for Access, but this is the first time I've tried to write code for Outlook, so I'm still not familiar with some of the terminology.

    Here is the code that I have written behind a button on my Access form.  I tested it on my computer (I removed the .send command for the test).  It does everything I want except put it on another calendar.  I checked with the guy who set up the church's email system.  He said there is a mailbox called "Church Events" that was created for this purpose.  What line(s) would I insert and where in order to put this meeting on the "Church Events" mailbox/calendar?  Thanks.

    Private Sub cmdScheduleMeeting_Click()
    Dim dteDate As Date
    Dim dteStart As Date
    Dim dteEnd As Date
    Dim strLocation As String
    Dim strSubject As String
    Dim strInvitees As String
    Dim myOutlook As Outlook.Application
    Dim myMeeting As AppointmentItem
    Dim booOffsite As Boolean
    With Me
        dteDate = !EventDate
        dteStart = !StartTime
        dteEnd = !EndTime
        strLocation = EventLocation(!EventID) ' user-defined function
        strSubject = !Event
        strInvitees = MembersEmailsByMinistry(!MinistryID)  ' user-defined function
        booOffsite = !Offsite
    End With
    Set myOutlook = CreateObject("outlook.application")
    Set myMeeting = myOutlook.CreateItem(olAppointmentItem)
    With myMeeting
        If booOffsite = False Then
            .Resources = strLocation
        End If
        ..MeetingStatus = olMeeting
        .RequiredAttendees = strInvitees
        .Subject = strSubject
        .Start = dteDate + dteStart
        .End = dteDate + dteEnd
        .ReminderMinutesBeforeStart = 15
        .Location = strLocation
        .Save
        .Send
    End With
    Set myMeeting = Nothing
    Set myOutlook = Nothing
    End Sub


    Jill Marlow


    Ken Slovak MVP - Outlook
    Thursday, November 29, 2012 7:30 PM
    Moderator
  • Thanks.  The alias for that folder is "Churchevents".  I'll try that the next chance I get.  I'll post if it works or not.

    Jill Marlow


    Jill Marlow

    Thursday, November 29, 2012 8:03 PM
  • Sorry for the long delay.  I have been busy with other things and haven't had a chance to try your suggestion until now.

    I inserted the code you suggested into my program, but when it gets to the line "Set oRecip=oApp.CreateRecipient("churchevents")", I get an error that says "Object does not support this property or method".  Is there some particular library that needs to be used for this to work correctly?

    Jill


    Jill Marlow

    Tuesday, January 29, 2013 4:44 PM
  • Sorry about that, my mistake. The NameSpace object has a CreateRecipient() method, not the Outlook.Application object. Use Set oRecip = oNS.CreateRecipient().

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "Jill Marlow" <=?utf-8?B?SmlsbCBNYXJsb3c=?=> wrote in message news:88a88f85-b5f0-49e2-972d-4fcf48067fed...

    Sorry for the long delay.  I have been busy with other things and haven't had a chance to try your suggestion until now.

    I inserted the code you suggested into my program, but when it gets to the line "Set oRecip=oApp.CreateRecipient("churchevents")", I get an error that says "Object does not support this property or method".  Is there some particular library that needs to be used for this to work correctly?

    Jill


    Jill Marlow


    Ken Slovak MVP - Outlook
    Wednesday, January 30, 2013 2:52 PM
    Moderator
  • I made the correction you suggested.  I got an error on the next line, but I found that if I changed it to Set oFolder = oNS.GetSharedDefaultFolder(oRecip, olFolderCalendar), it worked properly; however, it did a couple of things I didn't want it to.  First, in addition to putting it on the Church Events calendar, which is what I wanted, it also put the meeting on My Calendar, which I don't want.  The person scheduling the event more than likely is not going to be attending the event, so I don't want it put on My Calendar.  Second, I deliberately chose a date and time on my test event when I knew the meeting room (Epworth Room) was already taken.  It "double-booked" the room.  Is there any way for Outlook to determine if the resource is already taken for the given date/time and return a message saying as such and then not schedule the meeting?

    Jill Marlow

    Wednesday, January 30, 2013 7:36 PM
  • When you create the item and save it the item will always be created in your default Calendar folder. If you don't want it there you must delete it from there.

    Remember though if you do that the meeting attendees won't be tallied in the shared mailbox Calendar, meeting updates won't be propogated, and most other meeting functionality won't work correctly.

    For resource booking see http://support.microsoft.com/kb/291616, http://www.windowsitpro.com/article/outlook2010/Q-How-can-I-book-resources-such-as-a-conference-room-in-Outlook-2010--129884 and http://www.slipstick.com/outlook/calendar/scheduling-resources-outlook/


    Ken Slovak MVP - Outlook

    Wednesday, January 30, 2013 7:53 PM
    Moderator
  • Currently, the Church Events folder is a room mailbox.  I asked our email administrator if he could either change it to a user account and make everyone a delegate or just delete the account and create a new user account making all users delegates.  If that is done, is there a way programatically to create a meeting on behalf of the account to which you are a delegate?

    Jill Marlow

    Thursday, January 31, 2013 4:40 PM
  • You have to create an appointment in the default folder and move it. To do otherwise, except at the MAPI level, would require starting Outlook with a profile that included that mailbox.
     
    You can also use one of the FreeBusy methods to check a resource mailbox for conflicting bookings. Recipient.FreeBusy() or AddressEntry.GetFreeBusy() or ExchangeUser.GetFreeBusy() can all be used, depending on the object for which you have a refrence.

    Ken Slovak MVP - Outlook

    Friday, February 1, 2013 9:56 PM
    Moderator
  • I added the Church Events mailbox to my profile so its folders are now displayed under mine in the pane on the left of the email screen.  Its calendar is listed under mine in the My Calendar group.  How would I programatically move an appointment from my calendar to the Church Events calendar, and would I move it before or after the .Send command?  I can have the appointment go to the Church Events calendar by always including it on the invitees list, but I don't know how to prevent it from going to my own calendar.  If I create an appointment manually, I can add a meeting to the Church Events calendar and it doesn't put it on my own calendar, but if I run the code I showed earlier in the thread, it puts it on my calendar, but not on the Church Events calendar.

    Jill Marlow

    Thursday, February 7, 2013 2:56 PM
  • I keep telling you, you create the appointment and it goes to your default calendar and then you move it. At that point the meeting invitations and updates stop being tallied. The tallying only happens for items in the default calendar.

    You can't change the way Outlook works. You have to work within the limitations you have.


    Ken Slovak MVP - Outlook

    Thursday, February 7, 2013 4:24 PM
    Moderator
  • At the risk of incurring your wrath even further, would the SendUsingAccount property be applicable here, or is that just for MailItem Objects?  I found the following example and modified it for my application:

    Dim oAccount as Outlook.Account   

    For Each oAccount In Applications.Sessions.Accounts
            If oAccount.DisplayName = "Church Events" Then
                .SendUsingAccount = oAccount
                .Send
            End If
        Next

    It returned an error in the first line saying "Object required."  If this could be used on a MeetingItem object, then what would I put after "For Each oAccount In"?


    Jill Marlow

    Friday, February 8, 2013 7:01 PM
  • You haven't incurred my wrath, or even irritation. It's just that no matter how many times you ask the answer isn't going to change. Appointment creation goes to the default Calendar folder and tallying only happens there in that folder. It's more or less the same for tasks and task delegation and reports, only in the default folder.

    SendUsingAccount, as the name implies, is for which account of your configured accounts is used to send an item. It is a member property for MailItem, AppointmentItem, MeetingItem and some other types of items. It has no bearing at all on what you want though, it only affects which account is used to send out meeting invitations when it applies to AppointmentItem or MeetingItem.

    I'm afraid that your options are only what's been discussed already.


    Ken Slovak MVP - Outlook

    Friday, February 8, 2013 7:29 PM
    Moderator
  • OK, but if I did someday want to use SendUsingAccount for some other reason, how would I specify the account I wanted to use?  I wouldn't have to use the For Each...Next as was in the example I found.  If I just put in a statement, "Set oAccount=", what would I put on the right side of the equal sign?

    Jill Marlow

    Saturday, February 9, 2013 4:56 AM
  • For VBA code you wouldn't use "Set" for one thing. SendUsingAccount is what's called an "object property". It's not an object. Correct syntax should use Set for objects (NameSpace, Recipients, etc.) and not for object properties such as Account.

    Earlier versions of the Outlook object model never made that distinction, so everything used Set. Since Outlook 2007 the product group has made that distinction, so in this case no Set for SendUsingAccount.

    You'd need some way to identify which Account you want to use. You could iterate the Accounts collection using a For other other loop structure, you could use an index number (oAccount = collectionAccounts.Item(1), you could use the DisplayName (oAccount = collectionAccounts.Item("MyEmailAccount").

    A good idea if you have questions is to use the Outlook VBA project's Object Browser help. That usually has little code snippets illustrating how you use a particular item in the object model.


    Ken Slovak MVP - Outlook

    Monday, February 11, 2013 3:34 PM
    Moderator