To let your Outlook auto delete the emails from a specific sender from specific days, you can read this article. Here we will show you the detailed steps to use VBA code to get it.

When it comes to auto deleting emails, you may firstly think of the “AutoArchive” feature. However, it cannot filter the specific senders when auto archiving emails. Therefore, for instance, if you would like to auto delete the emails from a specific sender after x days, you should use the other means, such as the following one.

Auto Delete the Emails from a Specific Sender after X Days

  1. At the very outset, start your Outlook application.
  2. Then, trigger Outlook VBA editor according to “How to Run VBA Code in Your Outlook“.
  3. Next, copy the following VBA code into “ThisOutlookSession” project.
Public WithEvents objInboxItems As Outlook.Items

Private Sub Application_Startup()
    Set objInboxItems = Outlook.Application.Session.GetDefaultFolder(olFolderInbox).Items
 
    Call DeleteEmailsFromSpecificSenderAfterXDays
End Sub

Private Sub objInboxItems_ItemAdd(ByVal Item As Object)
    Dim objMail As Outlook.MailItem
 
    If TypeOf Item Is MailItem Then
       Set objMail = Item
 
       'From the specific sender
       If objMail.SenderEmailAddress = "bob_black@datanumen.com" Then
          'Set expiry time - after 5 days
          objMail.ExpiryTime = objMail.ReceivedTime + 4
          objMail.Save
       End If
    End If
End Sub

Private Sub DeleteEmailsFromSpecificSenderAfterXDays()
    Dim strFilter As String
    Dim objExpiredItems As Outlook.Items
    Dim objExpiredMail As Outlook.MailItem
 
    strFilter = "[ExpiryTime] <= " & Chr(34) & Now & Chr(34)
 
    'Get all expired items
    Set objExpiredItems = objInboxItems.Restrict(strFilter)
 
    For i = objExpiredItems.Count To 1 Step -1
        If objExpiredItems(i).Class = olMail Then
           Set objExpiredMail = objExpiredItems(i)
 
           'Auto delete expired emails from the specific sender
           If objExpiredMail.SenderEmailAddress = "bob_black@datanumen.com" Then
              objExpiredMail.Delete
           End If
        End If
    Next
End Sub

VBA Code - Auto Delete the Emails from a Specific Sender after Specific Days

  1. After that, restart Outlook to activate this macro.
  2. Since then, every time when a new email from the specific sender arrives in Inbox, it will be assigned with a specific expiry time – the specific days after it is received.Auto Added Expiry Time
  3. Then, every time you start Outlook, Outlook will auto check and delete the expired mails from the specific sender.Auto Deleted Expired Emails from a Specific Sender

Restore Outlook Data after Corruption

Perhaps you have encountered a variety of errors and troubles in Outlook. Then, have you ever confronted Outlook corruption? For example, if you frequently exit Outlook improperly, your PST file tends to get damaged. Generally, in such a case, you can select to retrieve Outlook data from backups. Or you can either use inbox repair tool or a reliable external tool, such as DataNumen Outlook Repair.

Author Introduction:

Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including recover sql and outlook repair software products. For more information visit www.datanumen.com

Be the first to comment
             

Multiple users have ever experienced the issue that Windows gets stuck on Welcome screen when booting. Therefore, in this article, we will introduce 9 solutions to this problem.

Are you plagued by the trouble that Windows gets stuck on Welcome screen? Are you looking for some effective solutions to fix it? In the followings, we are going to show you 9 efficient and handy means to fix it. Now, read on to get the details.

Windows Is Stuck on Welcome Screen

1. Disconnect All USB Devices

Perhaps your computer is connected with a lot of USB devices, including mouse, keyboard, USB Wi-Fi adapters, and USB flash drives, etc. So many connected USB devices can lead Windows stuck in Welcome screen for a long time. Thereby, the right solution to this cause is disconnecting all USB devices and restart Windows again.

2. Disconnect from the Internet

In addition, some users discover that Windows getting stuck on Welcome screen stems from its trying to connect to wireless connection. Under this circumstance, you need to disconnect the internet and then reboot Windows.

3. Startup Repair

Besides, Windows provides a native feature – “Startup/Automatic Repair” to fix startup issue, including stuck Welcome screen. You can firstly insert installation media to your PC and boot from it. Then, you should choose language as well as other preferences and click “Next”. After that, you can proceed to choose “Repair your computer” > “Troubleshoot” > “Advanced Options” > “Startup/Automatic Repair”

4. System File Check

At times, corrupted or lost system files can also cause this issue. In this scenario, you need to repair the system files, which can be achieved via System File Check (SFC). Firstly, boot PC from a bootable drive and select language and others. Then, press “Shift + F10” to open Command Prompt. Type “sfc /scannow” and “Enter”.

5. Run CHKDSK

Also, there are chances that the internal drive is malfunctioning, such as having bad sectors. In this situation, you ought to check and repair the disk via CHKDSK. You can relaunch Command Prompt like the above solution. Then, input “chkdsk c: /f /r” and press “Enter” in Command Prompt.

6. Bootrec

Moreover, it is likely that something bad occurs to the booting sector or booting configurations. In this situation, you can try to repair it with the inbuilt “bootrec” tool. Just access Command Prompt and use the following lines.

"bootrec /fixmbr" and press "Enter"
"bootrec /fixboot" and press "Enter"
"bootrec /scanos" and press "Enter"
"bootrec /rebuildbcd" and press "Enter"

 

7. Restart Windows Update Service

Furthermore, in some cases, malfunctioning Windows Update Service can result in this problem. In face of this cause, you can restart this service and then rename some files. First off, open Command Prompt. Then, type the following command lines one by one.

"net stop wuauserv" and press "Enter"
"cd %systemroot%" and press "Enter"
"ren SoftwareDistribution SD.old" and press "Enter"
"net start wuauserv" and press "Enter"

8. System Restore

What’s more, you can also try “System Restore” feature to restore Windows to an earlier version. In the first place, reboot the PC from a bootable drive and select “Repair your computer” > “Troubleshoot” > “Advanced Options” > “System Restore”. Later, you can just follow onscreen instructions.

9. Replace Hard Drive

Assuming that all suggested solutions cannot help you, it is very possible that the internal drive in your computer may be seriously corrupted. At that time, you have no choice but to replace this drive as soon as possible. After replacing it, you can restore backups to the new disk, such as to recover Outlook data from backed up Outlook files.

Author Introduction:

Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including recover Sql Server and outlook repair software products. For more information visit www.datanumen.com

Be the first to comment
             

If you’ve enabled “auto format internet and network paths with hyperlinks” feature in Outlook, the email addresses will be auto formatted with “mailto” links, too. Now, if you want to batch remove all email links, you can use the way in this post.

Perhaps you have noticed that the internet paths and email addresses will be converted into hyperlinks automatically. It is because that Outlook is set to auto format the internet and network paths with hyperlinks by default, as shown in the following screenshot.

AutoFormat internet and network paths with hyperlinks

In reality, for most of the users, they merely hope to format network paths with hyperlinks. They don’t like to format email addresses with “mailto” hyperlinks. In this case, they long for a method to quickly remove all email links in batches. Now, in the followings, we will introduce such a method.

Batch Remove All Email Links in Outlook Message

  1. At first, launch Outlook program.
  2. Then, trigger VBA editor by clicking the “Visual Basic” button in “Developer” ribbon.
  3. Next, in the “Microsoft Visual Basic for Applications” window, copy the code below into an unused module.
Sub RemoveMailtoHyperlinks()
    Dim objMail As Outlook.MailItem
    Dim objMailDocument As Word.Document
    Dim objHyperlinks As Word.Hyperlinks
    Dim i As Long
    Dim objHyperlink As Word.Hyperlink
    Dim strLinkText, strLinkAddress As String
 
    'Get the mail
    Select Case Outlook.Application.ActiveWindow.Class
           Case olInspector
                Set objMail = ActiveInspector.CurrentItem
           Case olExplorer
                Set objMail = ActiveExplorer.Selection.Item(1)
    End Select
 
    Set objMailDocument = objMail.GetInspector.WordEditor
    Set objHyperlinks = objMailDocument.Hyperlinks
 
    If objHyperlinks.Count > 0 Then
       For i = objHyperlinks.Count To 1 Step -1
           Set objHyperlink = objHyperlinks.Item(i)
           strLinkText = objHyperlink.TextToDisplay
           strLinkAddress = objHyperlink.Address
 
           'Get the hyperlink of email address
           If InStr(strLinkText, "@") > 0 And Left(strLinkAddress, 7) = "mailto:" And InStr(strLinkText, "@") > 0 Then
 
              'Remove this hyperlink
              objHyperlink.Delete
           End If
       Next
    Else
       MsgBox "No Hyperlink!", vbExclamation + vbOKOnly
    End If
End Sub

VBA Code - Batch Remove All Email Links in Outlook Message

  1. After that, add this macro to Quick Access Toolbar or ribbon.
  2. Finally, you can have a try.
  • First off, compose an email which contains hyperlinks of network paths and email addresses, like the following screenshot.Sample Email
  • Then, click the macro button.
  • When macro completes, as you can see, the “mailto” hyperlinks of email addresses have been removed.Batch Removed Email Links in Message

Watch Out for Unknown Links

You must have ever received the emails which have a lot of hyperlinks in body. If this email is from an unknown sender or its hyperlinks are in unknown domains, you should never readily open the links. It is because that they may be malicious. Once you open them, your Outlook file and even the whole computer can be virus infected. At that time, it is too late to regret. What you can do is to first kill viruses by antivirus software and then resort to a remarkable Outlook recovery tool to fix Outlook file, such as DataNumen Outlook Repair.

Author Introduction:

Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including damaged mdf and outlook repair software products. For more information visit www.datanumen.com

Be the first to comment