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
A Outlook 2019 Help with forwarding email without mentioning the previous email sender. Outlook VBA and Custom Forms 0
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
Rupert Dragwater How to permanently remove an email address Using Outlook 9
K vba code to auto download email into a specific folder in local hard disk as and when any new email arrives in Inbox/subfolder Outlook VBA and Custom Forms 0
F Auto changing email subject line in bulk Using Outlook 2
F Want to add second email to Outlook for business use Using Outlook 3
kburrows Outlook Email Body Text Disappears/Overlaps, Folders Switch Around when You Hover, Excel Opens Randomly and Runs in the Background - Profile Corrupt? Using Outlook 0
J Outlook 365 Outlook Macro to Sort emails by column "Received" to view the latest email received Outlook VBA and Custom Forms 0
J Macro to send email as alias Outlook VBA and Custom Forms 0
M Shift Delete doesn't delete email from server Using Outlook 4
K Incorporate selection from combobox into body of email Outlook VBA and Custom Forms 0
L Why are some email automatically going to "archive" Using Outlook 2
M Outlook Macro to save as Email with a file name format : Date_Timestamp_Sender initial_Email subject Outlook VBA and Custom Forms 0
B Outlook 2019 Custom Email form - Edit default email form Outlook VBA and Custom Forms 6
F Add a category before "Send an Email When You Add an Appointment to Your Calendar" Outlook VBA and Custom Forms 0
T Problem when requesting to view an email in a browser Using Outlook 0
J Outlook 365 Forward Email Subject to my inbox when new email arrive in shared inbox Using Outlook 0
HarvMan Archive Email Manually Using Outlook 1
L Fetch, edit and forward an email with VBA outlook Outlook VBA and Custom Forms 2
S New Email "From" box stopped working Using Outlook 0
Rupert Dragwater Duplicate email in Folder Using Outlook 8
M "Attachment Detacher for Outlook" add in, does it update the server copy of the email? Using Outlook 1
W Outlook 365 I am getting the "Either there is no default mail client" error when I try to send an email on excel Office 365 Using Outlook 1
MattC Changing the font of an email with VBA Outlook VBA and Custom Forms 0
L Specific Incoming Email Address Immediately Deleted Using Outlook 2
Witzker Outlook 2019 Macro to send an Email Template from User Defined Contact Form Outlook VBA and Custom Forms 0
Witzker Outlook 2019 Edit contact from email does not open the user defined contactform Using Outlook 3
V Macro to mark email with a Category Outlook VBA and Custom Forms 4
R Roadrunner Email Settings | Contact Roadrunner Customer Support Outlook VBA and Custom Forms 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 3
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

Similar threads

Top