how to create a subfolders

how to create a subfolders

Post by brido » Wed, 09 Jul 2003 06:29:45



hi how do a create subfolder in in public folder's folders
im able to create a folder in the public folder but i can not create
subfolder in the new folder
can someone help

im using this function to create the folder in the public folder

'//////////////////////////////////////////////////////////////////////
' Function: createPublicFolder()
' Purpose:  Creates a mapi public folder with the specified name (from the
'           root of the mapi folder tree).
'
' Input:    szFolderName:       Name of folder
'           szUserName:         Credentials (Username)
'           szUserPwd:          Credentials (PWD)
'
' Output:   createPublicFolder  Contains Error code (if any)
'
' Note:  In order for this example to function correctly, it may be
necessary to include
' references to the following libraries: Active DS Type Library, Microsoft
CDO for
' Exchange Management Library, Microsoft Cluster Service Automation Classes,
' Microsoft CDO for Windows 2000 Library.
'//////////////////////////////////////////////////////////////////////
Public Function createPublicFolder(ByVal szFolderName As String, _
                                   ByVal szUserName As String, _
                                   ByVal szUserPwd As String) As Integer

    Dim objFolder As Variant
    Dim szConnString As String
    Dim oSysInfo As ActiveDs.ADSystemInfo
    Dim szDomainDNSName As String
    Dim szStorageName As String

    On Error GoTo errhandler

    ' Get the domain name.
    Set oSysInfo = New ActiveDs.ADSystemInfo
    szDomainDNSName = oSysInfo.DomainDNSName

    ' Get the storage name.
    szStorageName = "file://./backofficestorage/" + szDomainDNSName + "/"

    ' Create the folder.
    szConnString = szStorageName + "Public%20Folders/Projets/" +
szFolderName

    Set objFolder = CreateObject("cdo.folder")

    ' Set the folder properties.
    With objFolder
        .Description = "Root folder for " + szFolderName
        .ContentClass = "urn:content-classes:folder"

'.Fields("urn:schemas-microsoft-com:exch-data:schema-collection-ref") =
szConnString

.Fields("http://schemas.microsoft.com/exchange/outlook/outlookfolderclass")
= "IPF.Folder"
        .Fields.Update
        .DataSource.SaveTo szConnString
    End With

    createPublicFolder = 0

    ' Clean up.
    Set objFolder = Nothing
    Set oSysInfo = Nothing

    Exit Function

    ' Error handling.
errhandler:

    MsgBox Err.Number & " " & Err.Description

    createPublicFolder = 1
    ' Implement error logging here.
    Exit Function

End Function

 
 
 

1. create folder/subFolder wunder Inbox using CDO and JavaScrip in ASP file

I could create folder/subFolder under Inbox using CDO in ASP file using
JavaScrip with NO PROBLEM..
i.e. I could create Inbox\myFolder1\myFolder2....

However, I need to create a user-defined folder(i.e. MyFolder) where all
default folders(i.e.Inbox, Outbox, Sent Items.....) are

So that I can see the list something like as follows

    Inbox
    MyFolder
    OutBox
    Sent Item
        -
        -

I could find the MSDN doc how to do it. I tried exactly the way it said,
but it doesn't work. Any help will be appreciated.  -Meekyung

2. Exchange 5.5 Chat Service

3. how do i create subfolders under internet newsgroups?

4. Problems with outcmd.dat

5. prevent users to create subfolders, delete item

6. IMS: Difference between Routing tab and Connection tab ?

7. how to create subfolders

8. Help with mail server login in Exchange v.4

9. create a new contact in a subfolder of Contacts with vbscript

10. Need help on how to search Exchange subfolders via Web, and content of folders

11. CDO/ASP list of unread mail items in subfolders

12. Search subfolders in public folders.

13. Parent folders reflecting subfolder content