Private Sub Comando122_Click()
Dim pola As Outlook.Application
Dim pTaskItem, ptaskitemasig As Outlook.TaskItem
Const olCreateTasks = 3
Const olDialog = 1
Const olSound = 8
Set pola = CreateObject("Outlook.Application")
sSubject = "Este es el asunto del mensaje"
sBody = "esto es una prueba"
dDue = Now()
dStart = Now()
sSoundFile = "alarm3"
bReminderSet = True
Set pTaskItem = pola.CreateItem(olCreateTasks)
pTaskItem.Subject = sSubject
pTaskItem.Body = sBody
pTaskItem.DueDate = dDue
pTaskItem.StartDate = dStart
pTaskItem.ReminderSet = bReminderSet
If bReminderSet Then
pTaskItem.ReminderSoundFile = sSoundFile
pTaskItem.ReminderTime = Now()
End If
pTaskItem.Recipients.Add ("lalala@lalalala.la")
pTaskItem.Attachments.Add "c:\prueba.xls"
pTaskItem.Save
pTaskItem.Assign
pTaskItem.Send
Set pTaskItem = Nothing
Set pola = Nothing
MsgBox "MENSAJE ENVIADO"
End Sub