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?


>
 
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
P Email address auto-completes work fine on laptop, but no longer on desktop Using Outlook 0
S Create Outlook Task from Template and append Body with Email Body Outlook VBA and Custom Forms 4
H Copying email address(es) in body of email and pasting in To field Outlook VBA and Custom Forms 1
A Search folder and move the email Outlook VBA and Custom Forms 0
P VBA to add email address to Outlook 365 rule Outlook VBA and Custom Forms 0
farrissf Outlook 2016 Optimizing Email Searches in Outlook 2016: Seeking Insights on Quick Search vs Advanced Search Features Using Outlook 0
D Delete selected text in outgoing email body Outlook VBA and Custom Forms 0
F Graphics in email / Mac recipient garbled Using Outlook 0
D Outlook VBA forward the selected email to the original sender’s email ID (including the email used in TO, CC Field) from the email chain Outlook VBA and Custom Forms 3
Witzker Outlook 2019 Macro to seach in all contact Folders for marked Email Adress Outlook VBA and Custom Forms 1
E Outlook 365 Save Selected Email Message as .msg File - oMail.Delete not working when SEARCH Outlook VBA and Custom Forms 0
S Email Macros to go to a SHARED Outlook mailbox Draft folder...NOT my personal Outlook Draft folder Using Outlook 2
R Outlook 365 VBA AUTO SEND WITH DELAY FOR EACH EMAIL Outlook VBA and Custom Forms 0
G Print email attachments when hit subfolder Outlook VBA and Custom Forms 1
C Spam Email? Using Outlook 2
G Automatically delete email when a condition is met Outlook VBA and Custom Forms 1
E Save Selected Email Message as .msg File - digitally sign email doesn't works Outlook VBA and Custom Forms 1
S Email was migrated from GoDaddy to Microsoft exchange. We lost IMAP ability Exchange Server Administration 1
R Outlook 365 How to integrate a third-party app with Outlook to track email and sms? Using Outlook 2
S Paperclip icon shows without attachment in email under Sent folder Using Outlook 0
B Outlook 2019 Automatically move email after assigning category Using Outlook 4
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 4
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 3
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

Similar threads

Back
Top