![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
I am trying to work out how to create a folder in Outlook that is on the same
level as the Inbox. The code I am working with is: Dim onMAPI As NameSpace Dim ofInboxFolder As MAPIFolder Dim ofNewFolder As MAPIFolder Set onMAPI = Application.GetNamespace("MAPI") Set ofInboxFolder = onMAPI.GetDefaultFolder(olFolderInbox) On Error Resume Next If ofInboxFolder.Folders("New Folder") Is Nothing Then ofInboxFolder.Folders.Add "New Folder", olFolderInbox End If Set ofInboxFolder = Nothing Set ofNewFolder = Nothing Set onMAPI = Nothing How to I make this: Set ofInboxFolder = onMAPI.GetDefaultFolder(olFolderInbox) be the "Mailbox - Username" Folder? On the same point, how do I then reference this new folder to capture when a new message is dropped/created in it? Thanks in advance. |
Ads |
#3
|
|||
|
|||
![]()
Thanks, that worked a treat...
"Sue Mosher [MVP-Outlook]" wrote: The Inbox has a Parent, and Folders.Add returns the new folder: Set newFolder = ofInboxFolder.Parent.Folders.Add("New Folder", olFolderInbox) -- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Correct way to get top-level folder of newly added store (new PST file) | [email protected] | Outlook and VBA | 2 | September 22nd 06 11:47 PM |
Permission error when creating rule in your own mailbox? | MC | Outlook - Installation | 6 | June 28th 06 03:02 PM |
Best Practices for creating Resource Mailbox Accounts | scooter79 | Outlook - Calandaring | 4 | June 22nd 06 08:47 PM |
create meeting request from another mailbox in VBA? | Nick B | Outlook and VBA | 1 | March 7th 06 07:09 PM |
Creating a PST file at the server level | Amwendwa | Outlook - General Queries | 8 | February 10th 06 01:01 PM |