Dim mainDoc As NotesDocument
'...set value of mainDoc...
Call mainDoc.RemoveItem( "Subject" )
Call mainDoc.Save( True, True )
Dim doc As NotesDocument
'...set value of doc...
Call doc.RemoveItem( "$FILE" )
Call doc.Save( True, True )
Sub changeField _
( doc As NotesDocument, oldName As String, _
newName As String )
If doc.HasItem( oldName ) Then
Call doc.ReplaceItemValue( newName, _
doc.GetItemValue( oldName ) )
Call doc.RemoveItem( oldName )
Call doc.Save( False, True )
End If
End Sub
例えば、phone アイテムの値を失わずに名前を「officePhone」に変更するには、スクリプトは次のように呼び出しを行います。
Dim doc as NotesDocument
'...set value of doc...
Call changeField( doc, "phone", "officePhone" )
Sub removeStoredForm_
( collection As NotesDocumentCollection )
Dim doc As NotesDocument
Set doc = collection.GetFirstDocument()
While Not(doc Is Nothing)
If doc.HasItem( "$TITLE" ) Then
formName = doc.GetItemValue( "$TITLE" )
Call doc.ReplaceItemValue( "Form", formName )
Call doc.RemoveItem( "$TITLE" )
Call doc.RemoveItem( "$INFO" )
Call doc.RemoveItem( "$WINDOWTITLE" )
Call doc.RemoveItem( "$BODY" )
Call doc.RemoveItem( "$ACTIONS" )
Call doc.Save( True, True )
End If
Set doc = collection.GetNextDocument(doc)
Wend
End Sub