![]() I have in Excell in Column A different calendarsĪs well as shared ones, Each row is a task Set objCalendar = objNameSpace.GetDefaultFolder(olFolderCalendar) ![]() Set objCalendar = objNameSpace.GetDefaultFolder(olFolderCalendar).Folders("Birthdays").Folders("DCalendar").Folders("ECalendar").Folders("holidaysinGreece") Set objCalendar = objNameSpace.GetDefaultFolder(olFolderCalendar).Folders("Birthdays").Folders("DCalendar").Folders("ECalendar")ĮlseIf xRg.Cells(i, 1) = "holidaysinGreece" Then Set objCalendar = objNameSpace.GetDefaultFolder(olFolderCalendar).Folders("Birthdays").Folders("DCalendar")ĮlseIf xRg.Cells(i, 1) = "ECalendar" Then Set objCalendar = objNameSpace.GetDefaultFolder(olFolderCalendar).Folders("Birthdays")ĮlseIf xRg.Cells(i, 1) = "DCalendar" Then However only the default calendar is updatedįor example i have Calendar, Birthdays, HolidaysinGreece, DCalendar, E Calendar In cell A i have the name of the calendar. I have a VBA in Excell that updates various calendars all of them in same level as inbox, If objNavFolder = "Philip Poremsky - Test" Then ' need to use the calendar name as displayed in calendar list Set objModule = (olModuleCalendar)įor i = 1 To This will work with default folders opened using Open Other User's Folder command or any folder shared from a sharing invitation. In order to access a folder received from a folder Invitation (or using Open Other User's folder command), you need find the folder on the navigation pane. NameĪll Public Folders folder in Exchange Public Folders store (Exchange only)Īccess a Folder Opened from a Sharing Invitation The following are the default folder names to use when referencing Outlook's default folders. To add an item to a folder in a shared mailbox, use Items.add: Set newCalFolder = NS.GetSharedDefaultFolder(objOwner, olFolderCalendar) Set objOwner = NS.CreateRecipient("maryc") Set NS = Application.GetNamespace("MAPI") You can use the mailbox owner's display name, alias, or email address when resolving the recipient. If the shared folder was opened from a sharing invitation (or Open Other User's folder command), you may need to use the method in the next section. ![]() To access a shared folder in another user's Exchange server mailbox, you need to use GetSharedDefaultFolder to reference the mailbox, after resolving the address to the folder. Set Items = GetFolderPath("New PST\Test Cal").ItemsĪfter adding the function to ThisOutlookSession:įunction GetFolderPath(ByVal FolderPath As String) As Outlook.FolderįolderPath = Right(FolderPath, Len(FolderPath) - 2) Call the function in your macro in this manner, where GetFolderPath is the function name: To use a specific folder in another data file in the profile, you need to use a function. To use the currently selected folder, you'll need to use: Set Items = Session.GetDefaultFolder(olFolderCalendar)._ When the folder is a subfolder under the default Calendar folder, use this instead: Set Items = Session.GetDefaultFolder(olFolderCalendar).Parent._ To use a folder at the same level as the Default folders (such as Calendar, Inbox etc), use this in place of Set Items = Ns.GetDefaultFolder(olFolderCalendar).Items, where SharedCal is the folder name:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |