Re: Email Forwarding

Status
Not open for further replies.
V

VG9tYXM

Hello Ken,

may be you could help me with similar Issue i think i can not handle easily.

I am not sure which way to go on incoming email and specific text in subject.

i see i have two options. On incoming email with text in Subject either run

script or make auto reply directly in outlook. What i am looking for is to

take a piece subject of email i got and repost it.

The incoming email subject looks like "Service call 10745707 has been

assigned to you."

What i would like to do is to reply to this emial like:

_send to: email@email.com

_subject: update 10745707

_Body: status=In Progress

I also though i could run a script on this like start application excel,

data to columns and then the code for send email. Anyway this looks to me

kinda to complicated and also when running this script my pc must be always

on.

Could you please help me with this issue?

Thank you in advance

Best regards

Tomas
wrote:


> Something like this, although this has no real error handling and needs to
> be tweaked so there's no possibility of an endless loop. This code would go
> into the ThisOutlookSession class module in the Outlook VBA project.

> You would of course have to sign the project or lower macro security to have
> it run.

> Private Sub Application_NewMailEx(ByVal EntryIDCollection As String)
> Dim aID() As String
> Dim oMail As Outlook.MailItem
> Dim oFwd As Outlook.MailItem
> Dim oNS As Outlook.NameSpace
> Dim oRecip As Outlook.Recipient
> Dim obj As Object
> Dim i As Long
> Dim sBody As String

> Const SEARCH_FOR As String = "Foobar"
> Const SEARCH_ADDY As String = "joe@foobar.com"
> Const FORWARD_TO As String = "moe@foobar.com"

> Set oNS = Application.GetNamespace("MAPI")

> On Error Resume Next

> aID = Split(EntryIDCollection, ",")
> For i = LBound(aID) To UBound(aID)
> Set obj = oNS.GetItemFromID(aID(i))
> If obj.Class = olMail Then
> Set oMail = obj
> sBody = oMail.Body
> If ((InStr(1, sBody, SEARCH_FOR, vbTextCompare) > 0) And _
> (oMail.SenderEmailAddress = SEARCH_ADDY)) Then

> Set oFwd = oMail.Forward
> Set oRecip = oFwd.Recipients.Add(FORWARD_TO)
> oRecip.Resolve
> If oRecip.Resolved Then
> oFwd.Send
> End If

> End If
> End If

> Set oMail = Nothing
> Set oFwd = Nothing
> Set oRecip = Nothing
> Set obj = Nothing
> Next

> Set oNS = Nothing
> End Sub

> >

>

> "TerryM" <TerryM> wrote in message
> news:48A46B4E-81E4-4034-8A6A-6D94DF9A3504@microsoft.com...
> > That's more of what I was looking for, but like I stated before. I'm
> > relatively new to VBA programming especially in Outlook. Were more of a
> > Delphi place, what would the code that I'm requiring look like?


>
 
K

Ken Slovak - [MVP - Outlook]

Please do not hijack other people's threads. What you are asking has nothing

to do with this thread.

If you want code to run obviously your computer must be running.

You can use an ItemAdd() handler or a NewMailEx() handler in the Outlook VBA

project and get the properties you want from the incoming item and use

Application.CreateItem(olMail) to create a new email. You can then populate

that item, say it's oMail as desired: oMail.Subject = "whatever",

oMail.Recipients.Add("email@email.com"), oMail.Body = "status=In Progress",

etc. You can then call Send() on the item to send it out.

"Tomas" <Tomas> wrote in message

news:C7C3F1E2-CF20-4433-9E52-F208C52D1404@microsoft.com...
> Hello Ken,
> may be you could help me with similar Issue i think i can not handle
> easily.
> I am not sure which way to go on incoming email and specific text in
> subject.

> i see i have two options. On incoming email with text in Subject either
> run
> script or make auto reply directly in outlook. What i am looking for is to
> take a piece subject of email i got and repost it.

> The incoming email subject looks like "Service call 10745707 has been
> assigned to you."

> What i would like to do is to reply to this emial like:
> _send to: email@email.com
> _subject: update 10745707
> _Body: status=In Progress

> I also though i could run a script on this like start application excel,
> data to columns and then the code for send email. Anyway this looks to me
> kinda to complicated and also when running this script my pc must be
> always
> on.

> Could you please help me with this issue?
> Thank you in advance
> Best regards
> Tomas
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
D Forwarding email based on the attachment file type and specific text found on the attachment file name Outlook VBA and Custom Forms 1
T Original email text not shown when replying or forwarding the email. Using Outlook 9
D Keep Original html body when forwarding an email Outlook VBA and Custom Forms 7
I Forwarding attachments in email received Outlook VBA and Custom Forms 3
A Forwarding email and replacing body Outlook VBA and Custom Forms 1
D VBA to edit body of incoming email and forwarding it Outlook VBA and Custom Forms 11
G VBA/Macro to remove page colour when replying or forwarding email Outlook VBA and Custom Forms 2
N Auto-forwarding an Email received from a specific Email address After slight modifications Using Outlook 4
D Forwarding Exchange Email without meeting updates Using Outlook 1
P Forwarding Email With Encrypted Attachment Exchange Server Administration 1
D Gmail mail is being delivered to a different email inbox in Outlook App 2021 Using Outlook 2
Albert McCann Outlook 2021 Outlook Display of HTML Email from two senders is glitchy Using Outlook 0
A How Do I Setup My Optonline.Net Email Account? Outlook VBA and Custom Forms 1
H Preventing the 'email address fetch from Exchange' crashing email reading code Exchange Server Administration 0
D multiple email accounts - why do I have to choose the "from" account address?? Using Outlook 2
Wotme create email only data file Using Outlook 1
F Outlook 2016 Email with attachments not being received Using Outlook 2
J Outlook 2019 Regex email addresses from body Outlook VBA and Custom Forms 6
D Prompt to prefix subject line whenever sending an email Outlook VBA and Custom Forms 3
J Quick steps delete original email and move reply/sent email to folder Using Outlook 2
C Wishlist Extract or scan new email addresses from out of office replies. Leads from OOO replies Using Outlook 1
T External email warning banner Outlook VBA and Custom Forms 0
A Links in email getting error message about group policy Using Outlook 4
richardwing Auto forward email that is moves into a specific outlook folder Outlook VBA and Custom Forms 5
J Recommendations for Outlook Duplicate Email Remover Using Outlook 6
Geldner Tweak Junk Email Reporting tool to default to particular email on send? Using Outlook 3
S Outlook 365 Can I change the possible range of highlighting colours when writing an Outlook email? Using Outlook 1
V Can one change the formatting of email title blocks? Using Outlook 0
P default font when sending email from browser Using Outlook 1
D VBA Macro to Print and Save email to network location Outlook VBA and Custom Forms 1
B IMAP server rejects sent email - cannot deliver messages Using Outlook 2
TedSch Small vba to kill political email Outlook VBA and Custom Forms 3
X Open Hyperlinks in an Outlook Email Message (Help with Diane's solution) Outlook VBA and Custom Forms 3
e_a_g_l_e_p_i Email notifications changed with Outlook 2021 Using Outlook 8
glnz How to retrieve or redo Verizon.net email password without affecting Outlook connection? Using Outlook 1
Z Copy specific email body text Outlook VBA and Custom Forms 0
D ISOmacro to extract active mail senders name and email, CC, Subject line, and filename of attachments and import them into premade excel spread sheet Outlook VBA and Custom Forms 2
M Outlook 365 refuses to send email Using Outlook 1
B Search and Find Email by Folder Name Outlook VBA and Custom Forms 2
K Closing external IMAP email... Outlook 2013 Using Outlook 0
L Capture email addresses and create a comma separated list Outlook VBA and Custom Forms 5
C Email bomb processing Outlook VBA and Custom Forms 1
O What would be the recommended way to change an email address (family member)? Using Outlook 0
A Outlook 2016 Macro to Reply, ReplyAll, or Forward(but with composing new email) Outlook VBA and Custom Forms 0
L Checking Sender Email Address for trusted domain from list on intranet Outlook VBA and Custom Forms 4
J How do you disable address search box when typing @ in body of email? Using Outlook 0
S HTML Code Embedded in String Within Open Outlook Email Preventing Replace(Application.ActiveInspector.CurrentItem.HTMLBody From Working Outlook VBA and Custom Forms 4
Victor.Ayala Automated way to check the option "Show this folder as an email Address Book" Outlook VBA and Custom Forms 2
D Wrong email address in Outlook 2003 "From" tab in new outgoing emails Using Outlook 4
F Forward incoming email with 4 embedded images in the body without original sender Outlook VBA and Custom Forms 22

Similar threads

Top