Creating Items in Public and Custom Folders
Inserting into Public and Custom Folders
If you wish to create an item in a Public or Custom folder, you'll need to first identify the FolderID of the folder you wish to read from (see Selecting Exchange Data). Once you know the FolderID, you can use this value as the ParentFolderId when you create a new object. To create an object in a custom or public folder, use the relevant object type as the table (or Inbox if the folder contains Messages). For example:Inserting into a subfolder of the Inbox:
INSERT INTO Inbox (Subject, FromEmailAddress, ToRecipients_EmailAddress, ParentFolderId) VALUES ('New email message', '[email protected]', '[email protected]', 'AAEuAAAAAAAa...')Inserting into a Public Folder that contains Contacts:
INSERT INTO Contacts (GivenName, Surname, EmailAddress1, ParentFolderId) VALUES ('Jill', 'Smith', '[email protected]', 'AAEuAAAAAAAa...')