Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub Initialize
- Dim session As New NotesSession
- Dim db As NotesDatabase
- Dim collection As NotesDocumentCollection
- Dim doc As NotesDocument
- Set db = session.CurrentDatabase
- Set collection = db.UnprocessedDocuments
- Dim strFirstname, strLastName, strForwardedAddress, strShortName, strDomain As String
- strDomain = "@example.com"
- Dim i As integer
- For i = 1 To collection.Count
- Set doc = collection.GetNthDocument( i )
- strFirstName = LCase(doc.FirstName(0))
- strLastName = LCase(doc.LastName(0))
- strShortName = LCase(doc.ShortName(0))
- If strShortName <> "" Then
- strForwardedAddress = strShortName + strDomain
- Else
- strForwardedAddress = strFirstName + "." + strLastName + strDomain
- End If
- 'MsgBox strForwardedAddress
- Call doc.ReplaceItemValue("MailSystem","5")
- Call doc.ReplaceItemValue("MailAddress",strForwardedAddress)
- Call doc.save(True,True)
- Next
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement