Upgrading Mail Folders After Running The Convert Task

After converting mail files to R5 with the server Convert task, existing mail
folders are left with their existing design.

The following agent script allows an administrator to finish the upgrade
process by also upgrading the design of existing folders.

The code could also be modified to make it the user's responsibility to run the
agent.
Sub Initialize
Dim session As New NotesSession
Dim db As New NotesDatabase("","")
Dim dViewDesign As NotesDocument
Dim itTemp As NotesItem
Dim vwOld As NotesView
Dim vwNew As NotesView
Dim vecMove As NotesViewEntryCollection
Dim sMFile As String
Dim iReturn As Integer
Dim sUid As String
Dim sFolder As String
Dim sMailServer As String

sMailServer="Mail/Test"

sMFile=Inputbox$("Enter the filename for the Mail file you would like to
upgrade.", "Upgrade Mail Folders","mail\")

If db.Open(sMailServer,sMFile) Then
If Lcase(db.DesignTemplateName)<>"stdr50mail" Then
Print "Design Template Error..."+db.DesignTemplateName
Exit Sub
End If

Forall v In db.Views

If v.IsFolder Then
sFolder=v.Name
If sFolder="Group Calendars" Or sFolder="Rules" Or sFolder="Meetings" Then
'Skip these folders
Elseif Left$(sFolder,2)="($" And Right$(sFolder,1)=")" Then
'Skip these folders
Else
iReturn=Messagebox ("Upgrade " & sFolder & " folder?", 3, "Upgrade Mail
Folders")
If iReturn=2 Then
Exit Sub
Elseif iReturn=6 Then

sUid=v.Universalid
Set dViewDesign=db.Getdocumentbyunid(sUid)

'Rename Folder
Set itTemp=dViewDesign.ReplaceItemValue("$Name",sFolder & "--TempCopy")
Set itTemp=dViewDesign.ReplaceItemValue("$TITLE",sFolder & "--TempCopy")
Call dViewDesign.save(True,False)

'Create New Folder with original name
Call db.EnableFolder(sFolder)
Set vwNew=db.GetView(sFolder)

'Move existing documents into new folder
Set vecMove=v.AllEntries
Call vecMove.PutAllInFolder(sFolder)
Call vecMove.RemoveAllFromFolder(sFolder & "--TempCopy")

'Delete old folder
Set vwOld=v
Call vwOld.Remove
End If
End If

End If
End Forall
Print "Done upgrading mail folders - " + sMFile
Else
Messagebox "Mail file " + sMFile + " not found.", 0, "Upgrade Mail Folders"
End If

End Sub
This was first published in November 2000

Dig deeper on Lotus Notes Domino Administration Tools

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchWinIT

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchEnterpriseLinux

SearchVirtualDataCentre.co.UK

Close