|
-
Aug 8th, 2007, 09:31 AM
#1
Thread Starter
Junior Member
[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
-
Aug 9th, 2007, 04:52 AM
#2
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.
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
Aug 9th, 2007, 08:20 AM
#3
Thread Starter
Junior Member
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
-
Aug 12th, 2007, 02:19 PM
#4
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
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Feb 16th, 2008, 07:28 AM
#5
New Member
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
-
Feb 16th, 2008, 09:50 AM
#6
Hyperactive Member
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.
Visual Studio .NET 2005/.NET Framework 2.0
-
Feb 17th, 2008, 12:35 AM
#7
New Member
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
-
Feb 17th, 2008, 12:43 AM
#8
New Member
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
-
Feb 17th, 2008, 11:32 AM
#9
Hyperactive Member
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
Visual Studio .NET 2005/.NET Framework 2.0
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|