Dim session As notessession
Dim db As notesdatabase
Dim uiws As New notesuiworkspace
Dim nSuccess As Integer
Dim strDialogMode As String
Dim m_profile As notesdocument
Dim profileName As String
Dim envVarName As String
Dim profileTitle As String
Dim profileForm As String
Dim checkChanges As String
Dim wks As New NotesUIWorkspace
envVarName="currentProfile"
profileForm="profileForm"
profileName="ColorProfile"
profileTitle="Цветовой профайл"
checkChanges="colorsChange"
On Error Goto errorhandler
Set session = New notessession
Set db = session.currentdatabase
If session.Notesbuildversion < 178 Then
Messagebox("This template doesn't support using the R5 client to modify your preferences.")
Exit Sub
End If
Set m_profile = db.GetProfileDocument(profileName)
' Call m_profile.save(False,False)
Call m_profile.ReplaceItemValue(checkChanges, "0")
strDialogMode = session.GetEnvironmentString("$DialogMode")
Call session.SetEnvironmentVar(envVarName,profileName)
If Len(strDialogMode) Then
Call m_profile.ReplaceItemValue("$DialogMode",Cint(strDialogMode))
Else
Call m_profile.RemoveItem("$DialogMode")
End If
nSuccess = uiws.dialogbox(profileForm,True,True,False,False,False,False,profileTitle,m_profile,True,Fa
lse,True)
If nSuccess Then
' If m_profile.Getitemvalue(checkChanges)(0) = "1" Then
Dim colorScheme As Variant
Dim CProfile As notesdocument
Set CProfile = db.getprofiledocument(profileName)
colorScheme = m_profile.getitemvalue("$colorScheme")
Call CProfile.replaceitemvalue("$colorScheme", colorScheme)
Call CProfile.save(False,False)
Call wks.ViewRebuild(True,True)
' End If
End If
ExitFunction:
Exit Sub
errorhandler:
Call RaiseError()
Resume ExitFunction