Function CreateFolder(db as NotesDatabase, foldernm as String) As Integer
	' creates folder if doesn't exist
	' technically, don't need to actually check for folder, as Enable won't create a duplicate, but it seems bad form to not do so
	
	Dim dbF As NotesView				' view/folder to check for and create if not existing
	
	On Error Goto FErrorHandler
	
	If (db Is Nothing) Then
		' give up
		Print "(CreateFolder) Missing app. Aborted."
		CreateFolder = 0
		Exit Function
	End If
	' have app, get folder
	Set dbF = db.GetView(foldernm)
	If Not (dbF Is Nothing) Then
		' folder already already exists, done
		Print "App: " & db.FilePath & ", already has folder. Skipped."
		CreateFolder = 1
	Else
		' doesn't exist create it, based on in-box
		Call db.EnableFolder( foldernm )
		CreateFolder = 1
		Print "Folder created."
	End If

	' return success/failure
FExit:
	Exit Function
FErrorHandler:
	Print "(ProcessPerson) Error: " & Cstr(Err) & " " & Error$ & ", on line: " & Cstr(Erl) & ". Returning nothing."
	CreateFolder = 0
	Resume FExit

End Function