Solutions Archive

When sending emails to any invalid recipient addresses, you would receive the undeliverable email notifications. At that point, if you may want to remove these email addresses from contacts, you can use the method shared in this post.

Have you ever received undeliverable email notifications listing the invalid email addresses? In general, you’ll get such emails after you send email to invalid recipient addresses. In this situation, it is generally suggested to remove these email addresses from Outlook contacts to prevent accidentally sending mails to them next time. Now, in the followings, we will share you a rapid solution to get it.

Quickly Remove the Invalid Recipient Addresses of Undeliverable Emails from Outlook Contacts

Remove the Invalid Recipient Addresses of Undeliverable Emails from Contacts

  1. For a start, in the Outlook window, press “Alt + F11” to access VBA editor.
  2. Next, you can put the following VBA code into an unused project or module.
Sub RemoveUndeliverableEmailAddressesfromContacts()
    Dim objSelection As Outlook.Selection
    Dim objContacts As Outlook.Items
    Dim objMail As Outlook.MailItem
    Dim i, n As Long
    Dim objWordApp As Word.Application
    Dim objWordDocument As Word.Document
    Dim strEmailAddress As String
    Dim strFilter As String
    Dim objFoundContact As Outlook.ContactItem
 
    'Get selected emails
    Set objSelection = Application.ActiveExplorer.Selection
    'Get the contacts
    Set objContacts = Application.Session.GetDefaultFolder(olFolderContacts).Items
 
    On Error Resume Next
    For Each objMail In objSelection
        objMail.Display
 
        Set objWordDocument = objMail.GetInspector.WordEditor
        Set objWordApp = objWordDocument.Application
        Set objSearchRange = objWordDocument.Range
 
        'Extract email addresses via wildcards
        With objWordApp.Selection.Find
            .Text = "[A-z,0-9]{1,}\@[A-z,0-9,.]{1,}"
            .MatchWildcards = True
            .Execute
        End With
 
        While objWordApp.Selection.Find.Found
              strEmailAddress = objWordApp.Selection.Text
 
              'Remove the invalid email addresses from the associated contacts
              strFilter = "[Email1Address] = " & strEmailAddress
              Set objFoundContact = objContacts.Find(strFilter)
              If Not (objFoundContact Is Nothing) Then
                 With objFoundContact
                     .Email1Address = ""
                     .Email1DisplayName = ""
                     .Save
                 End With
                 strFilter = ""
                 Set objFoundContact = Nothing
              Else
                 strFilter = "[Email2Address] = " & strEmailAddress
                 Set objFoundContact = objContacts.Find(strFilter)
                 If Not (objFoundContact Is Nothing) Then
                    With objFoundContact
                        .Email2Address = ""
                        .Email2DisplayName = ""
                        .Save
                    End With
                    strFilter = ""
                    Set objFoundContact = Nothing
                 Else
                    strFilter = "[Email3Address] = " & strEmailAddress
                    Set objFoundContact = objContacts.Find(strFilter)
                    If Not (objFoundContact Is Nothing) Then
                       With objFoundContact
                           .Email3Address = ""
                           .Email3DisplayName = ""
                           .Save
                       End With
                       strFilter = ""
                       Set objFoundContact = Nothing
                    End If
                End If
             End If
 
             objWordApp.Selection.Find.Execute
        Wend
 
       objMail.Close olDiscard
    Next
 
    MsgBox "Completed!", vbInformation
End Sub

VBA Code - Remove the Invalid Recipient Addresses of Undeliverable Emails from Contacts

  1. After that, close the current window.
  2. Later, add the new macro to Quick Access Toolbar. You can refer to the article – “How to Run VBA Code in Your Outlook“.
  3. Finally, you can run this macro by following the steps below:
  • In the first place, select the “Undeliverable” email messages.
  • Then, click the macro in the Quick Access Toolbar.Trigger Macro through Quick Access Toolbar
  • When macro finishes, you’ll receive the message prompting “Completed”.
  • Now, you could check the associated contacts, in which the invalid email addresses have been removed, like the screenshot below:Remove Invalid Email Addresses

Resolve Outlook Errors and Corruption

As we all know, Outlook can get subject to the issues and corruptions for various reasons. Hence, if you are a novice in Outlook, you’d better make some effective precautions, such as making periodical data backups, employing a powerful and reliable Outlook repair utility, like DataNumen Outlook Repair, and so on.

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

If you want to remove a specific color category from the contacts responding to all the members of a contact group, you can use the method introduced in this article.

Perhaps you have just created a new contact group from the contacts in a specific color category. Afterwards, you may think that this category is no longer needful. In this case, you may want to quickly remove the specific color category from the contacts corresponding to the group members. Here is a rapid method to realize it.

Batch Remove a Specific Color Category from All Members of an Outlook Contact Group

Remove a Specific Color Category from All Members of a Contact Group

  1. At the very outset, start your Outlook application.
  2. Then, open Outlook VBA editor via pressing “Alt + F11” key buttons.
  3. Next, in the new screen, copy and paste the VBA code below into an unused module.
Sub RemoveSpecificColorCategoryFromAllMembersOfContactGroup()
    Dim objContactGroup As Outlook.DistListItem
    Dim objCurrentFolder As Outlook.Folder
    Dim objCurrentFolderContacts As Outlook.Items
    Dim objDefaultFolderContacts As Outlook.Items
    Dim strCategory As String
    Dim n As Long
    Dim objMemeber As Object
    Dim strFilter As String
    Dim objFoundContact As Outlook.ContactItem
 
    'Get a selected contact group
    Set objContactGroup = Outlook.ActiveExplorer.Selection.Item(1)
 
    If Not (objContactGroup Is Nothing) Then
       strCategory = InputBox("Enter the specific color category:")
 
       If Trim(strCategory) <> "" Then
          Set objCurrentFolder = objContactGroup.Parent
          Set objCurrentFolderContacts = objCurrentFolder.Items.Restrict("[Email1Address]>''")
          Set objDefaultFolderContacts = Application.Session.GetDefaultFolder(olFolderContacts).Items.Restrict("[Email1Address]>''")
 
          'Find the contacts corresponding to the group members
          For n = 1 To objContactGroup.MemberCount
              Set objMember = objContactGroup.GetMember(n)
 
              strFilter = "[Email1Address] = '" & objMember.Address & "'"
              Set objFoundContact = objCurrentFolderContacts.Find(strFilter)
 
              If objFoundContact Is Nothing Then
                 Set objFoundContact = objDefaultFolderContacts.Find(strFilter)
              End If
 
              If Not (objFoundContact Is Nothing) Then
                 'Remove the specific color category
                 Call RemoveCategory(objFoundContact, strCategory)
                 objFoundContact.Save
              End If
         Next
       End If
    End If
End Sub

Sub RemoveCategory(ByVal objCurrentItem As Object, ByRef strSpecificCategory As String)
    Dim varCategories As Variant
    Dim i As Long
 
    varCategories = Split(objCurrentItem.Categories, ",")
    
    If UBound(varCategories) >= 0 Then
       For i = 0 To UBound(varCategories)
           If Trim(varCategories(i)) = strSpecificCategory Then
              varCategories(i) = ""
              objCurrentItem.Categories = Join(varCategories, ",")
              Exit Sub
           End If
       Next
    End If
End Sub

VBA Code - Remove a Specific Color Category from All Members of a Contact Group

  1. After that, you ought to add this macro to Quick Access Toolbar, which you can refer to the article – “How to Run VBA Code in Your Outlook“.
  2. Eventually, you can try this macro.
  • Firstly, select a source contact group. Here is my sample contact group.Group Members
  • Subsequently, click the macro in Quick Access Toolbar.Run Macro on Selected Contact Group
  • Later, you will be required to specify a color category in the popup dialog box.Specify a Color Category
  • After clicking “OK”, macro will continue to work.
  • When it finishes, the specific color category has been removed from the corresponding contacts of the group members, like the following image.Removed Color Category from Group Members

Deal with Miscellaneous Outlook Troubles

It is common for users to encounter diverse issues when working in Outlook. To be honest, it is difficult and even impossible to predict when problems will occur to Outlook. Hence, it’s recommended to back up your Outlook data regularly. Plus, you are better off keeping a remarkable repair tool in vicinity, like DataNumen Outlook Repair. It can fix PST issues without breaking a sweat.

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

Learn about the Adaptive Query Processing Mechanism, and what all it includes.

The Query Optimization feature in SQL Server works pretty well for deciding which execution plan will work best for any given query. It not only selects the cheapest plan, but also takes into account rows in a table. However, using the query optimizer for selecting the best execution plan is not always the best idea. At times it can also misjudge the tables and size of your database, thus selecting a plan that does not work well. And if the initial estimates by the optimizer turn out to be incorrect, the results returned would also most likely be incorrect.Understanding Adaptive Query Processing Mechanism In SQL Server

Therefore, to help users decide the genuinely best execution plan for their query, they have been provided with the Adaptive Query Processing feature. However, to make your SQL Server workload eligible for using this process, you will have to enable compatibility level 140. This is present in SQL Server 2017 edition, and can be activated through T –SQL. Continue reading to understand the complete Mechanism of Adaptive Query Processing in detail.

Batch Mode Memory Grant Feedback

SQL server needs access to a minimum amount of memory to complete execution, and some extra memory grant size to ensure that all rows are accommodated in the memory. The performance will not be optimized if memory grant size is not proper. Incase of excessive grant, memory will be wasted, along with reduced concurrency. Incase of less memory, there would be spills on the disk.

Batch Mode Adaptive Joins

Adaptive Query Processing In SQL Server 2017When using this feature, your choices of hash join, nested loop will be deferred till the time first input has not been scanned. The adaptive join operator here identifies a threshold, which will be responsible for deciding the best time to transition to nested loop plan. Given below is the procedure of adaptive joins.

  • Depending on the row count in the build join input, it will be decided whether loop join is appropriate or hash join. Incase loop join is optimal, you plan would automatically shift to nested loop algorithm.
  • If the input in build join is more than the threshold of a given row count, there would be no shift, and the plan will continue making use of hash join.

Interleaved Execution

This type of execution can make changes to the unidirectional boundary that marks the optimization and execution process for one single query. It also activates plans that can adapt on the basis of cardinality estimates that have been revised. If you come across a query for interleaved execution, which as of now is multi-statement table valued functions (MSTVFs), you should pause the process of optimization in the middle. And resume it after you have executed applicable subtree, and accurately collected the cardinality estimates. In SQL Server 2014 and 2016 editions, the cardinality guess of MSTVFs is fixed to ‘100’. The workload performance issues that arise because of these fixed estimates are handled using interleaved execution.

In case you are using a SQL Server instance in your company for any line of business application, always make sure you have a tool to fix sql and deal with contingencies.

Author Introduction:

Victor Simon is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including accdb repair and sql recovery software products. For more information visit https://www.datanumen.com/

Be the first to comment