I was creating shared folders in LotusScript using Doc.PutinFolder([FOLDERNAME],1).
This worked beautifully, but when a refresh of the template went through at night, the folders disappeared. This happened because the option "Prohibit design refresh or replace to modify" wasn't checked.
I hate doing things manually so I wrote the code below.
- In the mail template or your mail database, look for the view ($FolderInfo). This shows all the folders in the database as documents.
- The function gets a handle on the view name ($FolderInfo) and scrolls through all the documents in the view. Put the code in as a Library or whatever you prefer.
- The field $Flags holds information on the folder. "Prohibit design refresh or replace to modify" is represented by "P". If the "P" is not there, add it and the checkbox will be on when viewed in Domino Designer.
Function ProhibitDesignChangesOnFolder(FolderName As Variant)
Dim d As notesdatabase
Dim s As New notessession
Dim v As notesview
Dim doc As notesdocument
Dim t_fname As Variant
Dim temp As Variant
Set d = s.currentdatabase
Set v = d.getview("($folderinfo)")
Set doc = v.getfirstdocument
While Not(doc Is Nothing)
t_fname = doc.getitemvalue("$Name")
If t_fname(0) = FolderName Then
temp = doc.getitemvalue("$Flags")
If Instr(1,temp(0),"P") = 0 Then
'if it is not in the flags then add it to the end
'P is for prohibit design changes
Call doc.ReplaceItemValue("$Flags", temp(0) & "P")
doc.save 1,0
Exit Function
End If
End If
Set doc = v.getnextdocument(Doc)
Wend
End Function