[Outlook 2003] Email automation
Good day all,
I am a little unsure how to word this so I apologize in advance if it comes out a little confusing. I have a question and if the answer to this is no then I think proceeding with this will be very tough.
Question: Can a program/script/macro be actively running on a computer with MS Outlook open and trigger upon receipt of an email from a target email address?
Programming: Basically, here are the steps I want to go through if the above question can be answered with a yes:
1. email trigger received
2. open all unopened items currently in "Inbox"
3. parse through all unopened email items and concatenate them in a word/text/rtf document.
4. create reply email to the trigger
5. attach newly created document to this email
6. send email
It seems pretty basic, but seeing as how I am newly graduated and trying to think of some projects for myself to learn with I am having a bit of a hard time wrapping my mind around this.
Again, I apologize if this has been poorly presented. I appreciate anyones suggestions, comments and criticism of the idea.
Thanks,
Trent
Re: [Outlook 2003] Email automation
(I think) Everything up to step 6 can be done automatically.
Step 6 however will ask for user to click ok to send for each email created.
Re: [Outlook 2003] Email automation
Really? Now, I have some things running here at work that trigger emails all the time that do not require user interaction, is this something that is specific to using outlook?
I really appreciate the response!
Trent
Re: [Outlook 2003] Email automation
Everything can be automated but the Send part as it a security restriction to protect users from virus and such doing spam nodes from your system etc.
See these two links for more.
http://vbforums.com/showthread.php?t=402083
http://vbforums.com/showthread.php?t=402086
Re: [Outlook 2003] Email automation
Im also facing the same issue of Security prompt when i try to send mail via outlook 2003 .i have donwloaded a freeware Express Click Yes it solves the problem but can anyone provide sample code which can do the similar thing
Thanks In advance:)
Re: [Outlook 2003] Email automation
A better way to do this is to use Outlook Redemption. It allows you to send e-mails without the need to click yes when using Outlook. I have some basic code at work if you need a quick example.
Re: [Outlook 2003] Email automation
Hii
Thanks for your quick reply.Yes plz share the code you are using.I dont want to use any paid thing cuz i want to use it for my project.Before using
OutlookMail.Send method i was using SendKeys to send the mail but it fails when the system is in locked state.Is there any small code which i can add to my vbs script which can click yes on security popup.
Please share the code you are using
Thanks
Re: [Outlook 2003] Email automation
i found this code but its not working
Set fso = CreateObject("WScript.Shell")
While fso.AppActivate("Microsoft Outlook") = TRUE
wscript.sleep 1000
Wend
fso.SendKeys "a", True
fso.SendKeys "y", True
wscript.sleep 7000
While fso.AppActivate ("Microsoft Outlook") = TRUE
wscript.sleep 1000
Wend
fso.SendKeys "y", True
Re: [Outlook 2003] Email automation
You don't have to pay for redemtion as long as you don't sell it with your app.
Here is my code.
VB Code:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim objApp As Microsoft.Office.Interop.Outlook.Application
Dim objNS As Microsoft.Office.Interop.Outlook.NameSpace
Dim objSafeItem As Redemption.SafeMailItem
Dim objMailItem As Microsoft.Office.Interop.Outlook.MailItem
objApp = New Outlook.Application
objNS = objApp.GetNamespace("MAPI")
objNS.Logon("Outlook", "", False, False)
objMailItem = objApp.CreateItem(OlItemType.olMailItem)
objSafeItem = New SafeMailItem
objSafeItem.Item = objMailItem
'objSafeItem.
objSafeItem.Subject = "TestMessage"
objSafeItem.Body = "TestMessage"
'objMailItem.RTFBody = "TestMessage rtf"
objSafeItem.Attachments.Add("c:\17680.pdf")
'objMailItem.PrintOut()
objSafeItem.Send()
'objSafeItem.
objSafeItem = Nothing
objMailItem = Nothing
objNS.Logoff()
objNS = Nothing
objApp.Quit()
objApp = Nothing
End Sub