Insights Blog
-- Browse All Articles --
Physics Articles
Physics Tutorials
Physics Guides
Physics FAQ
Math Articles
Math Tutorials
Math Guides
Math FAQ
Education Articles
Education Guides
Bio/Chem Articles
Technology Guides
Computer Science Tutorials
Forums
Chemistry
Biology and Medical
Earth Sciences
Computer Science
Computing and Technology
DIY Projects
Trending
Featured Threads
Log in
Register
What's new
Search
Search
Search titles only
By:
Chemistry
Biology and Medical
Earth Sciences
Computer Science
Computing and Technology
DIY Projects
Menu
Log in
Register
Navigation
More options
Contact us
Close Menu
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Forums
Other Sciences
Computing and Technology
Move the emails with spam hyperlinks to Junk E-mail folder
Reply to thread
Message
[QUOTE="Rulty, post: 5766222, member: 623807"] It seems that you can do that via VBA codes. I search on google and find one may work to you. [CODE]Public WithEvents objIncomingItems As Outlook.Items Private Sub Application_Startup() Set objIncomingItems = Outlook.Application.Session.GetDefaultFolder(olFolderInbox).Items End Sub Private Sub objIncomingItems_ItemAdd(ByVal objItem As Object) Dim objMail As Outlook.MailItem Dim objWordDocument As Word.Document Dim objHyperlinks As Word.Hyperlinks Dim i As Long Dim strURL As String Dim objJunkMailFolder As Outlook.Folder Set objJunkMailFolder = Application.Session.GetDefaultFolder(olFolderJunk) If TypeOf objItem Is MailItem Then Set objMail = objItem Set objWordDocument = objMail.GetInspector.WordEditor Set objHyperlinks = objWordDocument.Hyperlinks If objHyperlinks.Count > 0 Then For i = objHyperlinks.Count To 1 Step -1 strURL = objHyperlinks.Item(i).Address 'Check if the hyperlink addresses contain specific words 'You can change the condition as per your needs If InStr(LCase(strURL), "www.test.com") > 0 Or InStr(LCase(strURL), "www.sales.com") > 0 Then objMail.Move objJunkMailFolder End If Next i End If End If End Sub[/CODE] Good luck. [/QUOTE]
Insert quotes…
Post reply
Forums
Other Sciences
Computing and Technology
Move the emails with spam hyperlinks to Junk E-mail folder
Back
Top