ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Vba - Generating Micr Outlook Alert from excel (https://www.excelbanter.com/excel-programming/306824-vba-generating-micr-outlook-alert-excel.html)

ajliaks[_28_]

Vba - Generating Micr Outlook Alert from excel
 
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.


---
Message posted from http://www.ExcelForum.com/


p[_2_]

Vba - Generating Micr Outlook Alert from excel
 
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
"ajliaks " wrote in message
...
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.


---
Message posted from http://www.ExcelForum.com/





All times are GMT +1. The time now is 03:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com