Voilà j'ai mis en place un Annuaire Mobile à partir de la tâche Dircat de Domino. Mon Annuaire "mobile.nsf"
Je souhaite que mes utilisateurs récupérent cette annuaire et qu'il soit disponible quand ils veulent envoyer un mail.
Pour cela, j'utilise un bouton pour qu'il click dessus, la base est répliquée depuis le serveur, le notes.ini est modifié pour ajouter mobile.nsf en tant que 2ème Annuaire à consulter en + du names local.
Tout fonctionne bien ou presque, car la base n'apparaît pas dans le réplicateur, et le but est que les modifications soient récupérées
Est-ce que vous auriez une idée, erreur dans le code ? serveur v7.03 et Client v7.0.2
Merci d'avance
- Code : Tout sélectionner
Sub Click(Source As Button)
On Error Goto printerror
Dim session As New NotesSession
Dim workspace As New NotesUIWorkspace
Dim DayList(6) As String
'Modification de ces declarations
Server = "Server/Org"
Path = "mobile.nsf"
'Declaration du chemin du carnet d'adresse en commun
Set dbNames = session.GetDatabase("", "names.nsf")
Dim db As New NotesDatabase( Server, Path )
Dim replica As New NotesDatabase("","")
'Current location name retrieve (via notes.ini file)
strLoc = session.getEnvironmentString("Location", True)
Print "strLoc" & strLoc
If strLoc="" Then
Print "Problem : Don't find the Location Document"
Exit Sub
End If
If Instr(strLoc, ",") Then
strLoc = Left(strLoc, Instr(strLoc, ",")-1)
End If
strSearch(1) = "*"
strSearch(2) = strLoc
Set vwSites = dbNames.GetView("($Locations)")
Set docSite = vwSites.GetDocumentByKey(strSearch)
' Setting for Current Location Name
If docSite Is Nothing Then
Print "Problem : Don't find the Location Document"
Exit Sub
Else
' Réplication activée
Set item = docSite.ReplaceItemValue( "Enabled", "1" )
' tous les jours
For j = 0 To 6
DayList(j)= Cstr( j + 1)
Next
docSite.Weekdays=DayList
'toutes les 60 minutes
docSite.Interval=60
Call docSite.Save( True, True )
End If
If replica.Open("", Path) Then
Messagebox( "One replica of "+Path+" database is in Local" )
Exit Sub
Else
Set replica = db.CreateReplica( "", Path )
'Ouverture de la réplique Local
Call workspace.OpenDatabase ( "", Path, "", "", False, False )
End If
'Modification des préférences utilisateurs, Mise à jour du parametre Notes.ini
CA_ini = session.GetEnvironmentString( "NAMES" , True)
If (CA_ini Like "*"+Path+"*") Then
Else
CA_ini = CA_ini + ","+Path
Call session.SetEnvironmentVar( "NAMES", CA_ini ,True)
End If
Messagebox( "Succesfull, Thanks to close your Lotus Notes Client so that your new parameter is updated." )
Exit Sub
printerror:
Print "Erreur : " & Error & " ligne " & Erl
Exit Sub
End Sub