By submitting your personal information, you agree that TechTarget and its partners may contact you regarding relevant content, products and special offers.
simply an upgrade of notes, they can easily lose folders that for one reason or
another do not have the "Do Not Allow design Refresh/Replace to Modify" option
set in the design properties
This is accomplished by treating the Folder like a NotesDocument Class item and
then modifying the $Flags field
Dim s As New NotesSession
Dim db As NotesDatabase
Dim uniqid As String
Dim count As Integer
Dim emaildbs As String
Set db = s.CurrentDatabase
dbdir = Inputbox("What directory do you want to run this against?" ,
dbfile = Inputbox$("What file do you want to run this against? (blank for
whole dir)" , "File", "")
If dbdir = "" Then
If dbfile <> "" Then
emaildbs = dbfile
emaildbs = Dir$("f:\notes\data\" & dbdir & "\*.nsf")
While emaildbs <> ""
dbname = dbdir & "\" & emaildbs
count = 0
Dim om As New NotesDatabase("","")
If Not(om.Open(db.Server, dbname)) Then
Msgbox "Could not open a mail database....Exiting!"
Forall Views In om.Views
If Views.IsFolder Then
count = count + 1
uniqid = Views.UniversalID
Set doc = om.GetDocumentByUNID(uniqid) 'This line treats
the folder like a NotesDocument to access the field called $Flags
Set flags = doc.GetFirstItem("$Flags")
If Not (flags.Text Like "*P*") Then
flags.Values = flags.Text & "P"
Call doc.Save(True, False)
entrytext = Views.Name & " in " & emaildbs & " has
entrytext = Views.Name & " in " & emaildbs & " is
'entrytext = "In " & emaildbs & " database, " & count & " folders
have been processed!"
If (dbfile <> "") Then
emaildbs = ""
emaildbs = Dir$()