ReplaceItemValue - $BusyName

Hello All,

I have a code I am working on that should replace the value of the $BusyName field in a calendar profile. I have multiple mail files that need to be updated with the new value.

Here is my code…

Sub Initialize

Dim ns As New Notessession

Dim db As NotesDatabase

Dim CDoc As NotesDocument

Dim BItem As NotesItem

Dim Owner As NotesItem



Set db = ns.CurrentDatabase

Set CDoc = db.GetProfileDocument ("calendarprofile")

Set Owner = CDoc.getitem ("Owner")

Set BItem = Cdoc.GetFirstItem("$BusyName")

Set BItem = Cdoc.ReplaceItemValue( "$BusyName", Owner.canonical)

Call Cdoc.Save( True, True )

End Sub

I cannot save it because there is an error on the “Set BItem = CDoc.ReplaceItemValue (”$BusyName", Owner.canonical)" line.

Any ideas as to what I am doing wrong?

TIA for all your help…

Subject: ReplaceItemValue - $BusyName

You obviously want to set the value of the item $BusyName to a name, right?

Try this:

Dim nmeOwner As NotesName

Set nmeOwner = New NotesName(CDoc.GetItemValue(“Owner”)(0))

Call CDoc.ReplaceItemValue(“$BusyTime”, nmeOwner.Canonical)

Subject: RE: ReplaceItemValue - $BusyName

Thanks Kenneth! It worked like a charm :-)…