Changing PDA's category from "Other" to "Main" in MS Outlook contacts

Changing PDA's category from "Other" to "Main" in MS Outlook contacts

After importing your contacts from a PDA or other importing tools, you will most probably encounter a problem of assigning phone numbers to category "Other" rather than "Mobile" or "Main (seen as work)".

One way of solving this issue is importing the contacts to Excel using internal Outlook mechanism and moving the data from one column to another. The fun starts when the target column is filled with data and simple overwriting the data is troublesome. As a result we are facing manual data overwriting.

I'd like to suggest a simple solution that consists of starting a procedure in VisualBAsic4App, which will move a phone number  to category "Other" and overwrite the data that exists there.

Sub Changing_mobile_other_to_main()
Dim oContact As ContactItem
Dim oContactFolder As MAPIFolder
Dim Ile&, nCounter&, item As ContactItem
Ile = 0
oContactFolder = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderContacts)
For Each item In oContactFolder.Items
DoEvents()
Ile = Ile + 1
oContact = item
If Not oContact Is Nothing Then
With oContact
If Len(Trim(.PrimaryTelephoneNumber)) = 0 And _
Len(Trim(.OtherTelephoneNumber)) > 0 Then
.PrimaryTelephoneNumber = Trim(.OtherTelephoneNumber)
.Save()
nCounter = nCounter + 1
End If
End With
End If
If Not oContact Is Nothing Then oContact = Nothing
Next
If Not oContactFolder Is Nothing Then oContactFolder = Nothing
MsgBox nCounter & " for" & How many & " processed contacts.", _
vbInformation, "Machine by OShon VBATools.pl"
End Sub


The categories of a PDA can be freely altered. For inexperienced VBA users, please refer to the article on Installation and running macros.

Other parameters relating to PDAs (for Outlook 2007).

.AssistantTelephoneNumber
.Business2TelephoneNumber
.BusinessTelephoneNumber
.CallbackTelephoneNumber
.CarTelephoneNumber
.CompanyMainTelephoneNumber
.Home2TelephoneNumber
.HomeFaxNumber
.HomeTelephoneNumber
.MobileTelephoneNumber
.OtherFaxNumber
.OtherTelephoneNumber
.PagerNumber
.PrimaryTelephoneNumber
.RadioTelephoneNumber
.TelexNumber
 

 (c) Shon Oskar 
© All rights reserved. No part or whole of this article may not be reproduced or published without prior permission.
Oryginal article publicate at this page
Leave a Comment
  • Please add 5 and 6 and type the answer here:
  • Post
Wiki - Revision Comment List(Revision Comment)
Sort by: Published Date | Most Recent | Most Useful
Comments
  • Peter Geelen - MSFT edited Revision 1. Comment: unscrambled title + remove en-us suffix

  • Maheshkumar S Tiwari edited Original. Comment: Added tags

Page 1 of 1 (2 items)
Wikis - Comment List
Sort by: Published Date | Most Recent | Most Useful
Posting comments is temporarily disabled until 10:00am PST on Saturday, December 14th. Thank you for your patience.
Comments
  • Maheshkumar S Tiwari edited Original. Comment: Added tags

  • Peter Geelen - MSFT edited Revision 1. Comment: unscrambled title + remove en-us suffix

Page 1 of 1 (2 items)