Script to Update Replication Settings

I have a script that I put together that will update the replication settings on a local machine through a button sent by email. I have looked at the code many many times and made several revisions. It doesn’t do anything. I’ve looked at examples on the forums and everything looks right. Can someone please take a look and give me some clues?

Sub Click(Source As Button)

Dim s As New NotesSession

Dim view As NotesView

Dim doc As NotesDocument



sNamesLine=s.GetEnvironmentString("NAMES", True)

nPos = Instr(sNamesLine, ",")

If nPos > 0 Then 

	sNamesLine = Left$(sNamesLine, nPos-1)

Else 

	sNamesLine = "names.nsf"

End If



Set db = New NotesDatabase( "",sNamesLine )



If Not(db.isOpen) Then 

	Messagebox("Could not locate your Name & Address book.")

	Exit Sub

End If





Set view = db.GetView("Locations") 



sLocation=s.GetEnvironmentString("Location", True)

nPos = Instr(sLocation, ",")

sLocation=Left$(sLocation, nPos-1)

Set doc=view.getdocumentbykey(sLocation)

Call doc.ReplaceItemValue("LocAllReplicationEnabled", "1")

Call doc.ReplaceItemValue("LocAllReplicateImmediate", "0")

Call doc.ReplaceItemValue("LocAllReplicateAtStart", "0")

Call doc.ReplaceItemValue("LocAllPromptAtStart", "0")

Call doc.ReplaceItemValue("LocAllEnabled", "1")

Call doc.ReplaceItemValue("LocAllInterval", "60")

Call doc.ReplaceItemValue("LocAllSchedule", "8:00:00 AM-10:00:00 PM")

Call doc.ReplaceItemValue("LocAllWeekDays","1:2:3:4:5:6:7")

Call doc.ReplaceItemValue("LocAllHiPriorityReplication", "1")

Call doc.ReplaceItemValue("LocAllSchedule", "8:00:00 AM-10:00:00 PM")

Call doc.ReplaceItemValue("LocAllWeekDays", "1:2:3:4:5:6:7")

Call doc.ReplaceItemValue("LocAllInterval", "10")

Call doc.Save(True, False) 

End Sub

Subject: Script to Update Replication Settings

Hi,

are you calling the right fields?

From my site document

Subject: RE: Script to Update Replication Settings

OOp. That was it. Copy and paste is not such a good thing sometimes. Thank you for you sharp eyes.