Dim doc As NotesDocument
Dim keys As Variant
'...set value of doc...
keys = doc.EncryptionKeys
Dim doc As NotesDocument
Dim item As NotesItem
Dim keys( 1 To 2 ) As String
'...set value of doc...
Forall i In doc.Items
i.IsEncrypted = True
End Forall
keys( 1 ) = "Top Secret"
keys( 2 ) = "Medium Secret"
doc.EncryptionKeys = keys
Call doc.Encrypt
Call doc.Save( True, True )