Re: Email Forwarding

  • Thread starter Thread starter VG9tYXM
  • Start date Start date
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
V iCloud For Windows v15.x - Missing Email Features ? Using Outlook 1
M Thunderbird email client - I wonder Using Outlook 0
D Outlook Desktop App Email Software Using Outlook 0
P Email and calendar entry text now shifts right about 3 tabs worth of space Using Outlook 1
J Outlook macro to run before email is being send Outlook VBA and Custom Forms 0
T Outlook 2010 Creating a email 'Group' in OL 2010 Using Outlook 2
D Send email from Outlook Alias using Mac? Using Outlook 0
T How to set Default FONT for Email composing ? Using Outlook 0
H Finding text in open email Outlook VBA and Custom Forms 12
T Why do Outlook Desktop 2021 tasks from my wife's email show up in my task pane? Using Outlook 2
A Opening a link from an email automatically Outlook VBA and Custom Forms 0
D Outlook 2021 New email reminder Using Outlook.com accounts in Outlook 1
Rupert Dragwater How do I remove an email ending with @gmail.com Using Outlook 4
M A plug in (or method) to keep email message formatting after it expires Using Outlook 1
L VBA to Triage Incoming Email Outlook VBA and Custom Forms 0
R Legacy Outlook on Mac Email Cache Using Outlook 0
P Email address auto-completes work fine on laptop, but no longer on desktop Using Outlook 3
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 2
Witzker Outlook 2019 Macro to seach in all contact Folders for marked Email Adress Outlook VBA and Custom Forms 0
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

Similar threads

Back
Top