Advertisement
gunawantw

Forwarded Address - RESET

Oct 17th, 2020 (edited)
3,601
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sub Initialize
  2.     Dim session As New NotesSession
  3.     Dim db As NotesDatabase
  4.     Dim collection As NotesDocumentCollection
  5.     Dim doc As NotesDocument
  6.     Set db = session.CurrentDatabase
  7.     Set collection = db.UnprocessedDocuments
  8.        
  9.     Dim strFirstname, strLastName, strForwardedAddress, strDomain As String
  10.     strDomain = "@example.com"
  11.    
  12.     Dim i As integer
  13.     For i = 1 To collection.Count
  14.         Set doc = collection.GetNthDocument( i )
  15.         strFirstName = LCase(doc.FirstName(0))
  16.         strLastName = LCase(doc.LastName(0))
  17.        
  18.         strForwardedAddress = strFirstName + "." + strLastName + strDomain
  19.         'MsgBox strForwardedAddress
  20.        
  21.         Call doc.ReplaceItemValue("MailAddress","")
  22.         Call doc.save(True,True)
  23.            
  24.     Next
  25.    
  26. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement