how to create subfolders

how to create subfolders

Post by brido » Thu, 10 Jul 2003 05:02:03



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

 
 
 

how to create subfolders

Post by Siegfried Weber [MVP » Thu, 10 Jul 2003 09:08:23


Just replace

szStorageName = "file://./backofficestorage/" + szDomainDNSName + "/"

with your folder path like that:

szStorageName = "file://./backofficestorage/" + szDomainDNSName +
"/MyFolder/"

--
<Cheers:Siegfried runat="server" />

Development Lead,

CDOLive LLC - The Microsoft Messaging and Collaboration Application Experts
http://www.cdolive.com

This information is provided "AS IS" with no warranties, and confers no
rights.
You assume all risk for your use. ? 2003 CDOLive LLC. All rights reserved.
Sample code subject to http://www.cdolive.com/disclaim.htm


> 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")

- Show quoted text -

Quote:> = "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


 
 
 

how to create subfolders

Post by brido » Fri, 11 Jul 2003 03:23:52


thank you !

I was doing that but forgetting the last "/" at the end!!

now, is it possible to create it mail enable with the same code?



> Just replace

> szStorageName = "file://./backofficestorage/" + szDomainDNSName + "/"

> with your folder path like that:

> szStorageName = "file://./backofficestorage/" + szDomainDNSName +
> "/MyFolder/"

> --
> <Cheers:Siegfried runat="server" />

> Development Lead,

> CDOLive LLC - The Microsoft Messaging and Collaboration Application
Experts
> http://www.cdolive.com

> This information is provided "AS IS" with no warranties, and confers no
> rights.
> You assume all risk for your use. ? 2003 CDOLive LLC. All rights reserved.
> Sample code subject to http://www.cdolive.com/disclaim.htm


> > 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")

- Show quoted text -

Quote:> > = "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

 
 
 

how to create subfolders

Post by brido » Fri, 11 Jul 2003 03:52:33


cool! I found it!!

    Dim objFolder As New CDO.Folder
    Dim objRecip As CDOEXM.IMailRecipient

    objFolder.DataSource.Open URLFolderName, , adModeReadWrite,
adFailIfNotExists

    Set objRecip = objFolder
    objRecip.MailEnable
    objFolder.DataSource.Save


> thank you !

> I was doing that but forgetting the last "/" at the end!!

> now, is it possible to create it mail enable with the same code?



> > Just replace

> > szStorageName = "file://./backofficestorage/" + szDomainDNSName + "/"

> > with your folder path like that:

> > szStorageName = "file://./backofficestorage/" + szDomainDNSName +
> > "/MyFolder/"

> > --
> > <Cheers:Siegfried runat="server" />

> > Development Lead,

> > CDOLive LLC - The Microsoft Messaging and Collaboration Application
> Experts
> > http://www.cdolive.com

> > This information is provided "AS IS" with no warranties, and confers no
> > rights.
> > You assume all risk for your use. ? 2003 CDOLive LLC. All rights
reserved.
> > Sample code subject to http://www.cdolive.com/disclaim.htm


> > > 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

'//////////////////////////////////////////////////////////////////////

- Show quoted text -

Quote:> > > ' 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.

'//////////////////////////////////////////////////////////////////////

- Show quoted text -

Quote:> > > 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")

- Show quoted text -

Quote:> > > = "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. how do i create subfolders under internet newsgroups?

OL2000, exserv5.5 - When i highlight internet newsgroups under public
folders and select file, new from the pull down menu in outlook, the
new folder option is greyed out. I have admin rights on the ex server.
Our ex server is not subscribing to any newsgroups, we just want to
create some internal newsgroups for company use. Can sub-folders of
internet newsgroups be created?

thanks

matt

2. Service Account Passwords

3. prevent users to create subfolders, delete item

4. Exchange Server and problems with viewing contacts over the Internet

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

6. hlp pls - internet users error - 'required privilege is not held by client'

7. how to create a subfolders

8. ADC Error

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