Outlook Contact Item.Restrict where FullName is NULL

GordonPrince

New Member
Outlook version
Outlook 365 64 bit
Email Account
Office 365 Exchange
Operating system::    Windows 10
Outlook version:     2016
Email type or host:    Exchange 365

I'm trying to restrict items in VBA based on FullName AND CompanyName. This works with
"[FullName] = 'Jake' AND [CompanyName] = 'ABC'"
but I can't figure out the syntax for:
[FullName] IS NULL AND [CompanyName] = 'ABC', or the reverse.
Anyone know what it is?
 
I did. [FullName] = 'Jake' AND [CompanyName] = '' (two apostrophes) returns 0 rows.
Also I tried "AND LEN([CompanyName] = 0) but that throws an invalid syntax error.
 
I did. [FullName] = 'Jake' AND [CompanyName] = '' (two apostrophes) returns 0 rows.
Also I tried "AND LEN([CompanyName] = 0) but that throws an invalid syntax error.
Actually today I can't get this to work, either: comboCrit = [FullName] = 'Jake' AND [CompanyName] = 'ABC'
I was sure it worked yesterday. Here's the code:
Dim olContactsFolder As Outlook.MAPIFolder
Dim olItems As Outlook.Items
Set olItems = olContactsFolder.Items.Restrict(comboCrit)
 
Similar threads
Thread starter Title Forum Replies Date
M VBA to change flag status in outlook contact item Outlook VBA and Custom Forms 3
M Outlook changes the "Modified" field when moving/copying a Contact. Using Outlook 0
U Outlook 2021 not showing contact cards in Searches Using Outlook 1
M Accessing ALL Outlook contact fields Outlook VBA and Custom Forms 3
I Button PDF in Outlook Contact custom form Outlook VBA and Custom Forms 1
O Outlook 365 - How to create / copy a new contact from an existing one? Using Outlook 5
M Disable Contact Card Results when using "Search People" in Outlook Ribbon Using Outlook 7
H Custom Outlook Contact Form VBA Outlook VBA and Custom Forms 1
Witzker Open Contact missing in Outlook 2019 Using Outlook 2
C Copy Outlook contact field value to another field Outlook VBA and Custom Forms 1
GregS 2016 Contact List being managed by Outlook.com? Using Outlook 1
B Outlook Business Contact Manager with SQL to Excel, User Defined Fields in BCM don't sync in SQL. Can I use VBA code to copy 1 field to another? BCM (Business Contact Manager) 0
L dynamic and static dates in Outlook contact "notes" ie. body Using Outlook 2
C Outlook Contact Manager - A viable successor? BCM (Business Contact Manager) 7
P Add a contact to the New Task in Outlook 2016 Using Outlook 2
dyny723 Outlook 2016: Code to link a contact to emails received from that contact Outlook VBA and Custom Forms 1
A remove or turn off outlook.com contact folder from outlook 2016 Using Outlook 4
R Outlook add-in to create new contact from an email. Using Outlook 0
J Outlook.com Contact Sync Issue Using Outlook.com accounts in Outlook 9
David Michaels Contact card shows blank Outlook 2013 Outlook VBA and Custom Forms 0
M OUTLOOK 2013 CONTACT PROPERTIES Using Outlook 0
O Outlook 2016 contact issues Using Outlook 2
Werewolf Workaround for the missing Activities tab in Contact Folder Properties in Outlook 2010? Using Outlook 2
Z Outlook.com Contact categories Using Outlook 8
Diane Poremsky Export (Save) Outlook Contact photos Using Outlook 0
J Unwanted US Holiday Contact folder in Outlook.com syncs to MAPI/Phone Address book Using Outlook.com accounts in Outlook 9
Diane Poremsky Outlook 2010 & Contact Activities Using Outlook 0
Diane Poremsky Outlook Connector Contact Sync Bug (Fixed) Using Outlook 0
Diane Poremsky Assign an Email Account to an Outlook Contact Using Outlook 0
Diane Poremsky Using Outlook's New Contact Cards Using Outlook 0
G Adding a contact to Outlook with a custom form using Access VBA Outlook VBA and Custom Forms 1
Christian Using Outlook's New Contact Cards Using Outlook 4
L Outlook 2007 Macro to Contact From a Field Using Outlook 3
C in outlook 2007-Contact Group-One name have 3 mail id-its possible? Using Outlook 3
H I need a developer to customize an Outlook Contact form Outlook VBA and Custom Forms 0
L Office 365 Outlook changing default contact folder Using Outlook 0
R Outlook 2010 Contact Synchronization - Outlook to Outlook.com Using Outlook.com accounts in Outlook 1
L Outlook 2007 Contact Form Code Not Working Using Outlook 20
D outlook 2013 contact list problem Using Outlook 0
Z Outlook 2007, clicking email addresses fails to open Contact Using Outlook 0
P mailto replication in Outlook Contact Notes Using Outlook 4
F I want to migrate Outlook journal to excel including contact names Using Outlook 10
A Adding a 2010 sharepoint contact list to outlook 2010 address book Using Outlook 1
Tech Checkers Make Outlook add Contact Card Address in Location Field based on Appointment Subject Name. Using Outlook 2
U Cannot access fields at bottom of Outlook 2013 Contact Rec. Using Outlook 1
C Outlook Custom Contact Form Attach Files in new notes fields Outlook VBA and Custom Forms 3
M which Outlook recommended to buy for moving Outlook 2000 versions Contact Data Using Outlook 2
G Issues with accessing Outlook Contact Picture with VBA Outlook VBA and Custom Forms 4
M resetting contact file icons in Outlook 2013 Using Outlook 1
iwshim mail merge and add the contact picture outlook 2013 Using Outlook 3

Similar threads

Back
Top