street address fields contain 0A0D

Status
Not open for further replies.

cimbian

Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
A 'play' with some third party software left me with a corrupt (unbacked-up :() contacts list. Several exports/imports via CSV to/from Excel got me back to what looked to be an okay position... BUT... Now, I have found that some of the street address fields have 0A0D embedded within them and I could do with a way of removing them without exporting/editing/reimporting through Excel.

It has become an issue as I need to export some of the contacts to MailChimp for a mailing campaign.

Thoughts?
 

niton

Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server 2010
Assuming your text is now on a single line, after you make a backup you can try replacing the 0A0D in the text.

Code:
Private Sub ContactFolderItems_replace_0A0D()

Dim cFolder As folder
Dim cItem As Object
Dim i As Long

' 0A = Line feed
' 0D = Carriage return

Set cFolder = Session.GetDefaultFolder(olFolderContacts)

For i = 1 To cFolder.Items.count
 
    Set cItem = cFolder.Items(i)
 
    If cItem.Class = olContact Then
 
        ' there are other Address related properties - BusinessAddress
        ' https://msdn.microsoft.com/en-us/vba/outlook-vba/articles/contactitem-object-outlook
        If InStr(cItem.HomeAddress, "0A0D") Then
         
            'cItem.Display
            'Debug.Print cItem.HomeAddress
         
            ' Two lines
            cItem.HomeAddress = Replace(cItem.HomeAddress, "0A0D", vbLf & vbCr)
         
            ' or one line
            ' cItem.HomeAddress = Replace(cItem.HomeAddress, "0A0D", vbLf)
         
            ' or one line
            ' cItem.HomeAddress = Replace(cItem.HomeAddress, "0A0D", vbCr)
         
            'Debug.Print cItem.HomeAddress
         
            ' Save manually after confirming 0A0D is not a legitimate part of the address
            cItem.Display
            Exit For    ' Remove once solution is confirmed
         
            ' or autosave, instead of Display, once solution is confirmed
            ' cItem.Save
         
        End If
 
    End If

Next

End Sub
 

cimbian

Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
Thanks Niton. Much appreciated. :)
 
Status
Not open for further replies.
Thread starter Similar threads Forum Replies Date
andyzack Street Addresses Formatting Glitch? Using Outlook 1
Terry Sullivan Sender Field Displays My E-Mail Address, Not My Name Using Outlook 1
L Email with correct To address but displaying name of a related person Using Outlook 0
1 Incorrectly Setup a Rule at Domain level to not allow address from outside domain Exchange Server Administration 2
D Is a sub folder under contacts necessary to be able to name an Address Book? Using Outlook 1
A Outlook replies not using "delivered to" address in From Using Outlook 1
T "Words In Recipient's Address" Rule Causes Outlook To Stop Processing Rules Using Outlook 3
B Extracting email addresses from a folder - how to also get the name of the person the address is for? Using Outlook 5
W Replyin to the reply-to email address Outlook VBA and Custom Forms 0
M Changing the preferred order for "Put this entry in" list for adding new contacts to the Address Book Using Outlook 1
B Change from Address Outlook VBA and Custom Forms 0
D Renaming Address Book Using Outlook 3
J Sent Items Folder NOT Showing Correct From Email Address Using Outlook 0
J Outlook Reply > From > Other Email Address... > Address Not Showing in Sent Items... From Email Outlook VBA and Custom Forms 0
M PST import from Outlook 2007 to 2010 - Address Book contacts all in 1 group Using Outlook 4
C Outlook Autocomplete suggestions showing wrong person's name against an email address Using Outlook 0
O Address list - company and non-company ? Using Outlook 0
Healy Consultants Macro to remove inside organization distribution list email address when reply to all recepients Outlook VBA and Custom Forms 0
L Email not going to address displayed Using Outlook 4
B When sending an email, I am showing 2 of my address's Using Outlook 1
oliv- determine to which address an email has been sent Outlook VBA and Custom Forms 3
N Exporting IM Address field Using Outlook 2
R outlook address book search broken Using Outlook 2
M Screen Scrape Sender IP Address Outlook VBA and Custom Forms 6
S Outlook 2007 printing wrong email address at top of page Using Outlook 8
N Outlook 2016 Address Book lookup Using Outlook 9
B Looking to get the Recipient email address (or even the "friendly name") from an email I am replying to using VBA Outlook VBA and Custom Forms 4
P AGGGGHHHH!!!! - Address Books and Contact Subfolders Using Outlook 5
Rupert Dragwater Deleted email address keeps showing up in reply Using Outlook 12
O How to display senders email address (column) Using Outlook 1
B When working on emails in a certain folder, when I hit reply or reply all, I would like it re always reply all and add an email address to send to Outlook VBA and Custom Forms 3
T Source of Outlook 2016 Address field dropdown "Other Suggestions" Using Outlook 3
I How to display sender's name instead of email address in outlook 2013 message Using Outlook 5
L Hubby and Wife names in email address Using Outlook 1
J Make business address defulkt in cureent not new contacts Using Outlook 1
S Example VBA Macro - To Conditionally Change the From Account and Add a BCC Address on Emails Outlook VBA and Custom Forms 11
Ajey Outlook 2013 Better address book Outlook Wishlist 0
B Do not change the From address in Outlook Templates Using Outlook 0
J Signatures that contain recipient's email address Outlook VBA and Custom Forms 7
L Using alpha numeric in email address Using Outlook 5
S Outlook 2007: Address Cards allow entering text! Why? Using Outlook 3
T Have Outlook 2016 suggest email address auto complete entries directly from the user's contacts list Using Outlook 10
T Have Outlook 2016 suggest email address auto complete entries directly from the user's contacts list Using Outlook 0
C Filter/Search emails sent to internal Exchange address only Using Outlook 2
C address book "when sending email" bug? Using Outlook 0
e_a_g_l_e_p_i Question about address book in Outlook 2010 Using Outlook 9
C VBA to Forward e-mails from certain address and between certain times Outlook VBA and Custom Forms 1
J Help Needed With Multi-Step Login Email Address Using Outlook.com accounts in Outlook 1
GregS Dropdown address list missing Using Outlook 1
J Outlook Rules - Changing auto-submit address in multiple rules, according to rule name Outlook VBA and Custom Forms 0
Similar threads


















































Top