Da ich das selber auch brauchte, hab ich mir schnell eine Function geschrieben.
Den Sandbox-Code (http://www-10.lotus.com/ldd/sandbox.nsf/ecc552f1ab6e46e4852568a90055c4cd/15abc8fb08a8b9ec85256c9400761713?OpenDocument) hab ich mir angesehen, erscheint mir aber nicht sehr modern (noch nie was von NotesViewEntryCollection gehört etc.), es sind u.a. auch nicht alle Variablen deklariert, kein Errorhandling etc.
Function ConvertPrivateFolderToPublic(strPrivateViewName As String) As String
'===========================================================================================
'Purpose:
'Converts a private folder to a shared folder.
'-------------------------------------------------------------------------------------------
'Arguments: Description:
'strPrivateViewName Name of the private folder you want to convert
'-------------------------------------------------------------------------------------------
'Return:
'String. "Success" if everything was OK, an error message if an error occured.
'-------------------------------------------------------------------------------------------
'Revision date: Programmer: Changes:
'02. Jun 2004 Matthias TMC New
'===========================================================================================
On Error Goto ERRORHANDLER
Dim session As New NotesSession
Dim db As NotesDatabase
Dim folderSource As NotesView
Dim folderTemp As NotesView
Dim folderTarget As NotesView
Dim vcSource As NotesViewEntryCollection
Dim vcTemp As NotesViewEntryCollection
Set db = session.CurrentDatabase
Set folderSource = db.GetView(strPrivateViewName)
'---> some errorhandling
If folderSource Is Nothing Then
ConvertPrivateFolderToPublic = "Error: Provided folder does not exist!"
Exit Function
End If
If Not folderSource.isFolder Then
ConvertPrivateFolderToPublic = "Error: Provided view is not a folder!"
Exit Function
End If
If Not folderSource.IsPrivate Then
ConvertPrivateFolderToPublic = "Error: Provided folder is not private!"
Exit Function
End If
'<---
'----> We create a temporary folder
Call db.EnableFolder( "folderTemporary" )
Set folderTemp = db.GetView( "folderTemporary" )
'<----
'----> Put all source documents in the temp folder
Set vcSource = folderSource.AllEntries
Call vcSource.PutAllInFolder("folderTemporary")
'<----
'----> delete the source folder
If Not folderSource Is Nothing Then Call folderSource.Remove
'<----
'----> We create a new folder
Call db.EnableFolder( strPrivateViewName )
Set folderTarget = db.GetView( strPrivateViewName )
'<----
'---> Put temp folder documents into the new folder
Set vcTemp = folderTemp.AllEntries
Call vcTemp.PutAllInFolder(strPrivateViewName)
'<----
'----> delete the temp folder
If Not folderTemp Is Nothing Then Call folderTemp.Remove
'<----
ConvertPrivateFolderToPublic = "Success"
EXIT_SCRIPT:
Exit Function
ERRORHANDLER:
ConvertPrivateFolderToPublic = "Error: " & Err & " - " & Error$
Resume EXIT_SCRIPT
End Function
Kann sein dass ich noch nicht alles berücksichtigt habe hier. Bitte um Feedback wie das Ding läuft.