Vba - Generating Micr Outlook Alert from excel

  • Thread starter Thread starter ajliaks
  • Start date Start date
A

ajliaks

Hi all,
It may be simple, but I have no idea how to do this!
Could somebody help, please?

From excel macro, I need to generate event in Microsoft Outlook, e.g.:

If today=12-08-2004 then

Outlook.task = "Make a cake"
Outlook.Note="Happy birthday"
Outlook.Calendar=Appointment in place... at 15.30 hs

end if

Any help will be really appreciate!
Aldo.
 
Ajliak,

modify the code below:

Function SendMail(EmailAddressTo, EmailAddressBCC, BodyText, FileToAttach,
Optional AttachmentTitle, Optional CounterNo, Optional MessageTitle)
Dim myOlApp, MyItem, myAttachment
Set myOlApp = CreateObject("Outlook.Application")
Set MyItem = myOlApp.CreateItem(olMailItem)
With MyItem
.To = EmailAddressTo
.BCC = EmailAddressBCC
.Subject = MessageTitle ' & " - CounterNo " & CounterNo
.Body = Chr(13) & Chr(13) & BodyText
End With

'myItem.Display

On Error Resume Next
If FileToAttach <> "" Then
Debug.Print "FileToAttach: " & FileToAttach & " -
AttachmentTitle: " & AttachmentTitle & " - CounterNo " & CounterNo
Set myAttachment = MyItem.Attachments
myAttachment.Add FileToAttach, , 2, AttachmentTitle
End If

With MyItem
'.Send
.Save
.Close
'.MoveTo MyOutBoxFolder ' another function
End With

DoEvents
Sleep 500
Set myOlApp = Nothing
Set MyItem = Nothing
Set myAttachment = Nothing

MoveToOutBoxFolder ' another function

End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top