View Single Post
  #2  
Old December 2nd 06, 02:16 AM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default How do I Replace a string with a variable?

strFind = "[FullName] = " & Chr(34) & strFullName & Chr(34)
Set itm = fld.Items.Find(strFind)

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Carol G" wrote in message news:Kt3ch.403350$5R2.166903@pd7urf3no...
I am trying to set the item using a variable strFullName
the variable value is "Cherif Abdallah" with the quotes included but If I
substitute the variable in the place of the name in the set item. I get an
error.

Thanks
Carol

***Everything declared here***

Dim strFullName As String

strFullName = "Cherif Abdallah"
strFullName = """" & strFullName & """"
Debug.Print strFullName

Set itm = fld.Items.Find("[FullName] = ""Cherif Abdallah""") 'This works
but I want to replace it with a variable.


Ads