I've managed to find code on the web that allows me to link to a contacts database in an Outlook public folder and I've managed to open a contact using the following line:
olContact is defined as an
MyContacts contains the name of the folder that these contacts are stored in.
After setting olContact I can successfully display the contact in the Outlook contact form using this:
olContact.Displ ay
All good so far but obviously I now want to replace the literal string "Darren" with a variable populated from my calling form. I've defined a variable called frmFirstName but I cannot get any variation of the following line to work. I've tried every comnbination of quote marks, square brackets and normal brackets but nothing works. Anyone got any ideas?
Cheers
David
Code:
Set olContact = MyContacts.Items.Find("[FirstName] = ""Darren""")
Outlook.Contact item
MyContacts contains the name of the folder that these contacts are stored in.
After setting olContact I can successfully display the contact in the Outlook contact form using this:
olContact.Displ ay
All good so far but obviously I now want to replace the literal string "Darren" with a variable populated from my calling form. I've defined a variable called frmFirstName but I cannot get any variation of the following line to work. I've tried every comnbination of quote marks, square brackets and normal brackets but nothing works. Anyone got any ideas?
Code:
Set olContact = MyContacts.Items.Find("[FirstName] = ""[frmFirstName]""")
David
Comment