This code sample uses a default Outlook folder:
Dim NS As Outlook.NameSpace
Dim objOwner As Outlook.Recipient
Set NS = Application.GetNamespace("MAPI")
Set objOwner = NS.CreateRecipient("maryc")
objOwner.Resolve
If objOwner.Resolved Then
'MsgBox objOwner.Name
Set newCalFolder = NS.GetSharedDefaultFolder(objOwner, olFolderCalendar)
End If
Dim NS As Outlook.NameSpace
Dim objOwner As Outlook.Recipient
Set NS = Application.GetNamespace("MAPI")
Set objOwner = NS.CreateRecipient("maryc")
objOwner.Resolve
If objOwner.Resolved Then
'MsgBox objOwner.Name
Set newCalFolder = NS.GetSharedDefaultFolder(objOwner, olFolderCalendar)
End If
To add an item to a folder in a shared mailbox, use Items.add:
Set objAppt = newCalFolder.Items.Add(olAppointmentItem)
Default Folder Names
The following are the default folder names to use when referencing Outlook's default folders.
Name | Value | Description |
---|---|---|
olFolderCalendar | 9 | Calendar folder |
olFolderContacts | 10 | Contacts folder |
olFolderDeletedItems | 3 | Deleted Items folder |
olFolderDrafts | 16 | Drafts folder |
olFolderInbox | 6 | Inbox folder |
olFolderJournal | 11 | Journal folder |
olFolderJunk | 23 | Junk E-Mail folder |
olFolderNotes | 12 | Notes folder |
olFolderOutbox | 4 | Outbox folder |
olFolderSentMail | 5 | Sent Mail folder |
olFolderSuggestedContacts | 30 | Suggested Contacts folder |
olFolderTasks | 13 | Tasks folder |
olFolderToDo | 28 | To Do folder |
olPublicFoldersAllPublicFolders | 18 | All Public Folders folder in Exchange Public Folders store (Exchange only) |
olFolderRssFeeds | 25 | RSS Feeds folder |
0 comments:
Post a Comment