Search for contact item with double quotes in Name

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

Is there any way to search for an Outlook contact item that has double
quotes in there Name/FileAs field ?

The FileAs field has like - Smith, David "Home"

Dim fldrs As Outlook.MAPIFolder
Dim SearchItem As Outlook.ContactItem

' this assignment doesn't work in VB as written, but I'm just trying to
represent the string
' I'm searching for
strSearch = "[FileAs] = "Smith, David "Home""

Set SearchItem = g_fldr.Items.Find(strSearch)
 
Create your search string like this, specifying the ASCII character for the
double-quote and using a single-quote to delimit the value of the field you
are searching on.

strSearch = "[FileAs]='Smith, David " & Chr(34) & "Home" & Chr(34) & "'"
 
Thanks, this does work


Dave Kane said:
Create your search string like this, specifying the ASCII character for the
double-quote and using a single-quote to delimit the value of the field you
are searching on.

strSearch = "[FileAs]='Smith, David " & Chr(34) & "Home" & Chr(34) & "'"
Dave said:
Is there any way to search for an Outlook contact item that has double
quotes in there Name/FileAs field ?

The FileAs field has like - Smith, David "Home"

Dim fldrs As Outlook.MAPIFolder
Dim SearchItem As Outlook.ContactItem

' this assignment doesn't work in VB as written, but I'm just trying to
represent the string
' I'm searching for
strSearch = "[FileAs] = "Smith, David "Home""

Set SearchItem = g_fldr.Items.Find(strSearch)
 
Back
Top