Click here to get back home

Missing contacts in sync, a possible solution

 HomeNewsGroups | Search | About
 microsoft.public.pocketpc.activesync    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Missing contacts in sync, a possible solution Bruno (3ro A) 11-22-2007
Posted by Bruno (3ro A) on November 22, 2007, 7:03 am
Please log in for more thread options
Hi,

I was having the same issues many of you reported in other posts: some
contacts did not get synched with my WM5 + ActiveSync 4.5 + Outlook
2003. Tried moving them around in folders in Outlook, cleaning them up
so that there was nothing like images or notes attached to them,
recreating the partnership, using ScanPST.exe, exporting all contacts
and reimporting them, all with no success.

Finally I saw that if I created new contacts, they were synched. So I
moved all my old contacts to a new folder called Backup, created a new
contact in my main folder with exactly the same first name, last name
of an old contact, and dragged and dropped that same contact from
Backup on top of this new contact. Outlook asked if I wanted to update
the contact's data, said yes and all data was updated, and synched to
WM5!

Doing this for all contacts is a pain, so here is a process to do it
batch:

- Copy the code section below to a new file with extension .vbs (ie
createcontacts.vbs) and save it somewhere.
- Create a folder for your contacts, name it "Backup"
- Move all your contacts from main folder to Backup
- Export Backup folder: File > Import and Export > Export to a file >
Comma separated values (Windows) > Select Backup folder > select a
file name (ie contacts.csv)
- Before you press finish, you must select Map custom fields and
remove your Notes field (sorry)
- Press Finish
- Edit createcontacts.vbs to reflect the path to your contacts.csv
file (ie: c:\Documents and Settings\Dan\My documents\contacts.csv)
- Execute createcontacts.vbs, you should now have all new contacts in
your main folder (just first name, last name)
- Drag all contacts from Backup folder to main folder, asking Outlook
to update all
- Finished!

Hope it helps!
Bruno



' createcontacs.vbs
' VBScript program to read a comma delimited file with Outlook
contacts and import it into Outlook.
'
'
----------------------------------------------------------------------
' Copyright (c) 2007 Bruno Gazzera
' http://www.brunogazzera.com
' Version 1.0 - 2007
'
' Based on work by Richard L. Mueller (see below)
'
' You have a royalty-free right to use, modify, reproduce, and
' distribute this script file in any way you find useful, provided
that
' you agree that the copyright owner above has no warranty,
obligations,
' or liability for such use.
'
'
----------------------------------------------------------------------

' The file with the exported contacts, you must enter a full path
here
' or just the name of the file if it is in the same folder as the .vbs
Const InpFile = "contactos3.csv"


'
----------------------------------------------------------------------
' No editing needed past this point
'
----------------------------------------------------------------------

Const olContactItem = 2
Dim objOutl, objContact,oTF,oFSO
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oTF = oFSO.OpenTextFile(InpFile,1,True)
Set objOutl = WScript.CreateObject("Outlook.Application")

sLine = oTF.ReadLine


Do While oTF.AtEndOfStream <> True
        sLine = oTF.ReadLine

        aLine = CSVParse(sLine)
        sFname = aLine(1)
        sLname = aLine(3)

        Set objContact = objOutl.CreateItem(olContactItem)
        objContact.FirstName = sFname
        objContact.LastName = sLname
        'objContact.Save()

        Set objContact = Nothing
Loop



' ReadCSV.vbs
' VBScript program to read a comma delimited file and convert the
' fields in each line into an array of values.
' Based on program by Michael Harris (a Microsoft MVP).
'
'
----------------------------------------------------------------------
' Copyright (c) 2007 Richard L. Mueller
' Hilltop Lab web site - http://www.rlmueller.net
' Version 1.0 - January 2, 2007
'
' Demonstrates how to read a Comma delimited file in VBScript. Uses a
' function that converts each line of the comma delimited file into
' an array of field values. Handles quoted strings and quotes and
' commas embedded in quoted strings.
'
' You have a royalty-free right to use, modify, reproduce, and
' distribute this script file in any way you find useful, provided
that
' you agree that the copyright owner above has no warranty,
obligations,
' or liability for such use.

Function CSVParse(ByVal strLine)
' Function to parse comma delimited line and return array
' of field values.

Dim arrFields
Dim blnIgnore
Dim intFieldCount
Dim intCursor
Dim intStart
Dim strChar
Dim strValue

Const QUOTE = """"
Const QUOTE2 = """"""

' Check for empty string and return empty array.
If (Len(Trim(strLine)) = 0) then
CSVParse = Array()
Exit Function
End If

' Initialize.
blnIgnore = False
intFieldCount = 0
intStart = 1
arrFields = Array()

' Add "," to delimit the last field.
strLine = strLine & ","

' Walk the string.
For intCursor = 1 To Len(strLine)
' Get a character.
strChar = Mid(strLine, intCursor, 1)
Select Case strChar
Case QUOTE
' Toggle the ignore flag.
blnIgnore = Not blnIgnore
Case ","
If Not blnIgnore Then
' Add element to the array.
ReDim Preserve arrFields(intFieldCount)
' Makes sure the "field" has a non-zero length.
If (intCursor - intStart > 0) Then
' Extract the field value.
strValue = Mid(strLine, intStart, _
intCursor - intStart)
' If it's a quoted string, use Mid to
' remove outer quotes and replace inner
' doubled quotes with single.
If (Left(strValue, 1) = QUOTE) Then
arrFields(intFieldCount) = _
Replace(Mid(strValue, 2, _
Len(strValue) - 2), QUOTE2, QUOTE)
Else
arrFields(intFieldCount) = strValue
End If
Else
' An empty field is an empty array element.
arrFields(intFieldCount) = Empty
End If
' increment for next field.
intFieldCount = intFieldCount + 1
intStart = intCursor + 1
End If
End Select
Next
' Return the array.
CSVParse = arrFields
End Function


Posted by Gary Mitchell on November 24, 2007, 5:42 pm
Please log in for more thread options
None of the solutions on web worked for me. Was gonna try
http://www.eggheadcafe.com/conversationposter.aspx?messageid=31187132&groupid=1568
but did the below first and it worked ...

My situation was same... New contacts sync OK. Old ones would not sync.

Note need two PCs connected to network, both with activesync and outlook.

Basic process - using 2nd PC pointing to 1st PC pst store the contacts synced
OK. So after sync I deleted contacts from main PC (ones that wouldn't sync) and
then synced phone to that PC. All the contacts then transferred from phone to
main PC.

This is exactly what I did...

Please backup your pst files before attempting this.....

1) Backup your 1st PC outlook contacts (File import export etc). Also good idea
to backup your pst as well just in case - right click Outlook properties from
within outlook on 1st PC, advanced to see pst file location of personal store
(pst). Create a backup copy.
2) Install activesync on 2nd PC
3) Point 2nd PC outlook to find pst on 1st PC. Right click Outlook properties
from within outlook on 2nd PC, select advanced, to see pst file location of
personal store. Close Outlook and Using explorer delete this file. (Back it up
first if you need it as above). Reopen outlook on 2nd PC and point it to the pst
store on first PC via network.
3) Hopefully the contacts will now sync OK via activesync on 2nd PC (they did
for me.)
4) Unplug PPC from 2nd PC
5) Before plugging in PPC to 1st PC - delete contacts from within outlook on 1st
PC (the ones that would not sync).
6) Plug in PPC into first PC and contacts should then sync from phone to outlook
on 1st PC.

Hope it works for you...


EggHeadCafe - .NET Developer Portal of Choice
http://www.eggheadcafe.com

Similar ThreadsPosted
Some contacts are missing on sync April 19, 2006, 12:42 pm
Missing Contacts on WM5 device March 14, 2006, 6:39 pm
Missing Contacts Option June 17, 2006, 9:59 am
Contacts - fields missing June 16, 2008, 11:57 am
Missing contacts in outlook August 3, 2008, 4:23 pm
Selected Categories Go Missing for Contacts January 12, 2006, 4:56 am
Possible Sync Error Solution July 30, 2005, 3:55 pm
Hi-volume Data Sync Disconnect Failure - Solution? February 14, 2007, 12:33 pm
Sync via category still missing from AS4.5 January 20, 2007, 10:15 am
Sync issue: Missing space between Company Name and Person October 6, 2005, 6:06 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap