If localNab.IsOpen Then
While Not doc Is Nothing
sF = "Form = 'Contact' & Type = 'Person' & @IsAvailable(ExpFromTD) & Certificate='" & telCertificate & "'"
Set nabcoll = localNab.Search(sF,Nothing,0)
Set nabdoc = nabcoll.GetFirstDocument
If Not nabdoc Is Nothing Then
Messagebox "Already exist"
Call nabcoll.DeleteDocument(nabdoc) ** It displays the message “Already exist”, but it doesn’t delete it. I have taken out the SetDOcValues, to check that it removes it, but it doesn’t **
Else
i = i + 1
setDocValues localNab, doc
End If
Set doc = coll.GetNextDocument(doc)
Wend
prompt$=Cstr(i) & " document(s) were exported to your local address book. Open local address book?"
If ws.Prompt(PROMPT_YESNO, db.Title, prompt$) Then
Call ws.OpenDatabase( "", nabfile)
End If
Else
msg$="Your local address book could not be found in the standard location. Please contact the helpdesk."
Msgbox msg$, 16, "Error"
End If