Dim notesSession As Object
Dim notesMailFile As Object
Dim notesDocument As Object
Dim notesField As Object
Dim receptores(1) As Variant
Dim copiados(2) As Variant
Dim Body As Object
'Cria Uma lista de destinatários
receptores(0) = "fulano@xxx.com.br"
'Cria Uma lista de copiados
copiados(0) = CStr(Environ("USERNAME"))
copiados(1) = "beltrano@xxx.com.br"
'Abre uma sessão do notes, abre a base de dados e cria um documento.
Set notesSession = CreateObject("Notes.NotesSession")
Set notesMailFile = notesSession.GetDataBase("", "names.nsf") '- *.nsf = arq. com lista de contatos
Set notesDocument = notesMailFile.CreateDocument
'Configura Subject, SendTo e Abre um novo corpo de e-mail
Set notesField = notesDocument.AppendItemValue("Subject", "PARECER ANÁLISE"
Set notesField = notesDocument.AppendItemValue("SendTo", receptores)
Set notesField = notesDocument.AppendItemValue("CopyTo", copiados)
Set notesField = notesDocument.CreateRichTextItem("Body")
'Escreve o texto padrão no e-mail.
With notesField
.AppendText "Prezadas,"
.AddNewLine (2)
.AppendText "Segue abaixo dados da unidade em pauta, para análise e parecer."
.AddNewLine (2)
.AppendText "Atenciosamente."
End With
'Envia o e-mail
notesDocument.Send False
'Limpa as variáveis
Set notesSession = Nothing
Set notesMailFile = Nothing
Set notesDocument = Nothing
Set notesField = Nothing