Hi Pascal! Been a while! Have a little problem. I have a user who has 100+ folders set up in her mail file. Another user needs all the folders set up in their mail file. I've got this little script to put in a button to send to the other user in order to copy all the files, but I get a type mismatch error on the bold line and I'm not sure what needs to be done to fix it. I commented out the section that copies the documents into the new folder because I just need the structure, not the contents.
Could you take a look and make suggestions?
thanks!
les
Leslie
Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual
Essential reading for anyone working with databases: The Fundamentals of Relational Database Design
Could you take a look and make suggestions?
thanks!
les
Code:
Sub Click(Source As Button)
Dim ws As New NotesUIWorkspace
Dim session As New NotesSession
Dim SourceServer As Variant
Dim SourceDatabase As Variant
Dim DestServer As Variant
Dim DestDatabase As Variant
Dim FolderString As Variant
Dim SourceDB As New NotesDatabase("Domino1/MetCt","mail\rhill.nsf")
Dim DestDB As New NotesDatabase("Domino1/MetCt","mail\landrews.nsf")
Dim viewTitle As NotesView
Dim colViewEntries As NotesViewEntryCollection
Dim doc As NotesDocument
Dim views As Variant
Dim nextdoc As NotesDocument
Dim newdoc As NotesDocument
Dim x As Integer
[b]views = SourceDB.Views 'all view in the data base[/b]
FolderString = "Saved"
Forall v In views 'Loop through all views
If Left(v.Name, Len(FolderString)) = FolderString Then
If v.IsFolder Then 'is it a folder?
x = 0
'Print "Copying folders " & v.Name
Call DestDB.EnableFolder(v.Name) 'Copies folder if it doesn't exist
Set viewTitle = SourceDB.GetView(v.Name)
Set colViewEntries = viewTitle.AllEntries 'Make an Entrycollection of all entries in folder
Set doc = viewTitle.GetFirstdocument
'While Not doc Is Nothing 'Loop through all docs in the Entrycollection
'x=x+1
'Print "Copying documents : " & x & " to " & v.Name & " Folder"
'Set newdoc = doc.CopyToDatabase(DestDB)
'Call newdoc.PutInFolder( v.Name )
'Set nextdoc = viewTitle.GetNextDocument(doc)
'Set doc = nextdoc
'Wend
End If
End If
End Forall
End Sub
Leslie
Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual
Essential reading for anyone working with databases: The Fundamentals of Relational Database Design