NashVegas
asked on
Using VBA to update a shared calendar
This article from MSDN talks about how to automate Outlook using VB:
http://support.microsoft.com/kb/220595
But is it possible to use VB to add calendar events on a shared calendar on an Exchange server as opposed to the user's default Outlook calendar? If so, how would one set a reference to a calendar in a location such as "https://email.institution.edu/public/Sub%20Folder/?Cmd=contents"?
http://support.microsoft.com/kb/220595
But is it possible to use VB to add calendar events on a shared calendar on an Exchange server as opposed to the user's default Outlook calendar? If so, how would one set a reference to a calendar in a location such as "https://email.institution.edu/public/Sub%20Folder/?Cmd=contents"?
ASKER
Thank you for the prompt response. It looks to me that this code provides a way to send an appointment item to a specific user which is something I will definitely have a use for, but not the solution in this particular case. Unless the URL for the shared calendar can be used in place of "name@name.com". Is there a different library function similar to "CreateRecipient" that could be used to point to the shared calendar rather than an indiviual user's calendar?
I must admit that I am not familiar with a URL shared calendar but the code I gave you will definately allow you to enter appointments on a shared calendar.
Note here...
Set objFolder = objNS.GetSharedDefaultFolder(objRecip, olFolderCalendar)
The key to this is for you to get the right name of the shared folder.
Note here...
Set objFolder = objNS.GetSharedDefaultFolder(objRecip, olFolderCalendar)
The key to this is for you to get the right name of the shared folder.
ASKER
So in this scenario, a specific user would have to create a calendar and share it with the other users who need access. Then "name@name.com" would be the calendar owner's email address and "GetSharedDefaultFolder" would reference the specific calendar they are sharing, correct? I think this might be okay (I'll have to run it by the users). But unless I'm missing something, I don't see where in the code the name of the shared calendar would be set. I would expect "GetSharedDefaultFolder" to mean "the default calendar for the specified user". So how would I define which of the user's calendars is the calendar to which I want to add an appointment?
I have only worked with shared calendars, where USER_A has given USER_B rights to their calendar. USER_B then has multiple calendars which they can see - It appears in the "Other Calendars" section. I have not seen your URL calendar but I imagine that if a user can manually add an item to this URL calendar then it must be a calendar folder on this users outlook - it might even appear as an "Other Calendar".
But your key to getting a users calendar is by the Recipient.
Your code will fail if the USER_B tries to get USER_A's calendar and USER_A has not allowed it.
But your key to getting a users calendar is by the Recipient.
Your code will fail if the USER_B tries to get USER_A's calendar and USER_A has not allowed it.
ASKER
I am certain that in our case, USER_A will not want these calendar events cluttering their default calendar. If USER_A created a second calendar called "SharedCalendar" and gave other users permissions to view that calendar, then that is the only way this solution might be acceptable.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
https://www.experts-exchange.com/questions/23972317/Creating-appointments-in-Public-Calendar-from-Access.html?sfQueryTermInfo=1+appoint+calendar+set
I found another thread that answered my question. I had searched before but somehow could not find this until now. I'll give you credit for helping me get on the right path. Thanks,
I found another thread that answered my question. I had searched before but somehow could not find this until now. I'll give you credit for helping me get on the right path. Thanks,
Open in new window