Re: Send an Auto Response to an email address held in the body
- From: Timjohn <Timjohn@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 16 Jun 2007 04:49:00 -0700
Michael, you are a STAR!!
Got it working great. Thank you very much.
Last question (I hope) is there a quick easy way to confirm that the
extracted string contains a valid email address?
Again many, many thanks,
Tim.
"Michael Bauer [MVP - Outlook]" wrote:
.
Please show how your code actually looks like.
After editing code you need to execute the Application_Startup procedure
manually (place the cursor into it and press f5) or restart Outlook.
Additionally, VBA will be executed only if the security settings are set to
medium or low (toolbar, click Tools/Macro/Security), or if you certify the
project.
--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Organize Outlook email:
<http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6>
Am Sat, 16 Jun 2007 02:01:00 -0700 schrieb Timjohn:
Hi Michael,"Reply
I've managed to get some vb working well in excel so I'm not thick but I
just can't seem to get my head round this. I know what I want to do and I
think I see what your code says but beyond that I seem to be lost. I've
copied your code into ThisOutlookSession, added an 'if Item.Subject =
Needed" then msgbox' in the parsemail sub just as a test, restartedOutlook
but nothing happens when mail arrives. I moved the msgbox outside theloop
but still nothing. If you have time your help is very much appreciated.<http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6>
Warm regards,
Tim
"Michael Bauer [MVP - Outlook]" wrote:
Copy that into ThisOutlookSession:
Private WithEvents Items As Outlook.Items
Private Sub Application_Startup()
Dim Ns As Outlook.NameSpace
Set Ns = Application.GetNamespace("MAPI")
Set Items = Ns.GetDefaultFolder(olFolderInbox).Items
End Sub
Private Sub Items_ItemAdd(ByVal Item As Object)
If TypeOf Item Is Outlook.MailItem Then
ParseMail Item
End If
End Sub
Public Sub ParseMail(Mail As Outlook.MailItem)
' continue
End Sub
In ParseMail, play with the mentioned functions to find and extract the
address from the Mail.Body property.
--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Organize Outlook email:
start!
Am Fri, 15 Jun 2007 00:07:03 -0700 schrieb Timjohn:
Thanks Michael, that looks exactly what I want. Now the awkward bit. IThisOutlookSession,
opened VB from within Outlook, opened Project1 and then
but I don't know where to put the code, don't really know where to
demarcation;I'll learn as I go but if you have time could you help!sample
Thanks, Tim
"Michael Bauer [MVP - Outlook]" wrote:
The ItemAdd event of the Inbox tells you when a new item arrives; a
lookingis in the VBA help file.
In that event compare the item's Subject property with what you're
forfor. An email address can be found by searching with the InStr function
a "@" character:
Dim pos&
pos=Instr(Item.Body, "@")
tells you the position of that character. If it's found start at that
position and use the Instr function again to find the right
youyou
must know what character that is, usually "'", or ">", or " ".
Then start at pos again and use the InStrRev function, which searches
backwards, that is it will find the left demarcation. If that's done
item'scan
use the Mid function to extract the address.
Call Application.CreateItem to create a new MailItem and then the
<http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6>well)Recipients.Add function to add the address (write Subject and Body as
and call Send.
--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Organize Outlook email:
somewhere.
Am Thu, 14 Jun 2007 15:02:01 -0700 schrieb Timjohn:
Hi,within
I receive emails from a web site and the respondents email address is
the body of the email, the email itself comes through a host
myI
want to be able to send a 'Thanks for your Interest' email as soon as
respondsinbox receives the request. All the emails that arrive have the samesubject
line so I can identify them. I tried Rules and Alerts but that
createdto
the sender of the email (the host) not the actual person making therequest
from the web site. Basically a simple email to be sent to an emailaddress
that will be found in the body is what I want. Can a script be
to
do
this, if so how? Any help very much appreciated. Tim
- Follow-Ups:
- Re: Send an Auto Response to an email address held in the body
- From: Michael Bauer [MVP - Outlook]
- Re: Send an Auto Response to an email address held in the body
- References:
- Re: Send an Auto Response to an email address held in the body
- From: Michael Bauer [MVP - Outlook]
- Re: Send an Auto Response to an email address held in the body
- From: Michael Bauer [MVP - Outlook]
- Re: Send an Auto Response to an email address held in the body
- From: Timjohn
- Re: Send an Auto Response to an email address held in the body
- From: Michael Bauer [MVP - Outlook]
- Re: Send an Auto Response to an email address held in the body
- Prev by Date: Re: Send an Auto Response to an email address held in the body
- Next by Date: Re: Changing ISP, can account info be changed by scripting?
- Previous by thread: Re: Send an Auto Response to an email address held in the body
- Next by thread: Re: Send an Auto Response to an email address held in the body
- Index(es):
Relevant Pages
|