Goal: My goal is to have OUTLOOK filter an incoming message based on keywords (which can be done with rules) but, I need to run a script that will automatically open the link within the email.
Configuration: Our back-end system has a button that says "Need Attention" this sends an email as follows Outlook 2013 Want to open in current page (chrome) as a new tab or in new window as long as it opens
LINKS HAVE BEEN CHANGED FOR SECURITY
" HTTP: " removed per posting requirements
SUBJECT: (always containing the same words except for the customer number)
Attn - Need Support for: LOC-12345 / Rep ID: mike / Tech: jacob / Status: new requests / Service: Standard Service
BODY (always containing the same words except for the customer number in both the body and hyperlink)
Attn - Need Support for: LOC-12345(customer number)
To view account, click the link below: //support.bo.ca/login.aspx?url=view_rfq.aspx?rfq_ID=12345
Summary: May seem like I'm just lazy and don't want to click a link. But the situation is that we have over 20 actions with 20 different email subjects, I have code for setting reminders and moving to particular folders but this would be great, because as soon as an account representative clicks the "Need Attention" button it will send an email to the assigned support group and pop up on their screen. We have this already in place with our phone system by recognizing the caller id and matching our database for that number if there's a hit it will auto open the customers page.
This is the code I've found but I don't understand how to make it work also I the thought of having maybe a code that will automatically generate a partial hyperlink, pull the customer ID and input it into the partial hyperlink and open the page? For example using the SplitWord entry to replace certain amount of characters from the beginning with the partial link and execute it?
(partial link) //support.bo.ca/login.aspx?url=view_rfq.aspx? rfq_ID= (customer ID) 12345 (complete link) //support.bo.ca/login.aspx?url=view_rfq.aspx? rfq_ID=12345
Private WithEvents myOlItems As Outlook.Items
Private Sub Application_Startup() Dim olApp As Outlook.Application Dim objNS As Outlook.NameSpace Set olApp = Outlook.Application Set objNS = olApp.GetNamespace("MAPI") Set myOlItems = objNS.GetDefaultFolder(olFolderInbox).Items End Sub
Private Sub myOlItems_ItemAdd(ByVal item As Object)
On Error GoTo ErrorHandler
Dim Msg As Outlook.MailItem
If TypeName(item) = "MailItem" Then
Set Msg = item
LaunchURL (item)
For Each SplitLine In bodyStringSplitLine
If InStr(SplitLine, "http://") > 0 Then
If InStr(SplitLine, "SomeSite") > 0 Then
bodyStringSplitWord = Split(SplitLine, " ")
For Each SplitWord In bodyStringSplitWord
If Left(SplitWord, 7) = "http://" Then
Shell ("C:\Program Files\Internet Explorer\IEXPLORE.EXE" & " " & SplitWord)
End If
Next
End If
End If
Next
End If
ProgramExit:
Exit Sub
ErrorHandler:
MsgBox Err.Number & " - " & Err.Description
Resume ProgramExit
End Sub
Thank you for any feedback Jacob