Automated way to check the option "Show this folder as an email Address Book"

Status
Not open for further replies.

Victor.Ayala

New Member
Outlook version
Outlook 2019 64-bit
Email Account
Office 365 Exchange
Hi, I need someone's help to point me in the right direction, I need to find an automated way to check the option "Show this folder as an email Address Book" for a "contactFolder" that was created using Microsoft Graph API. The problem is, I need to do this for multiple users, probably more than 100.

Why we need to check this option? Because, according to my client, checking this option makes the contacts available when users use the "To:", otherwise they cannot see (and use) the contacts in the "contactFolder".

I'm not an Outlook expert at all, I'm just a developer and regular Outlook user, so hopefully my question makes sense 😬

Greetings from Mexico
 
You need to use the ShowAsOutlookAB property - Microsoft's code sample is here - I don't have one yet - but am working on one.

 
This will enable all contact folders in the default mailbox as address books - assuming the folders are at the same level as the contacts folder. Remove .parent from the set fldfolder line if they are subfolders of the contacts.
Code:
Sub SetAsAddressbook()
    Dim olNS      As NameSpace
    Dim myOlApp   As Outlook.Application
    Dim fldFolder As Object
    Dim SubFolder As MAPIFolder
  
    Set myOlApp = Outlook.Application
    Set olNS = myOlApp.GetNamespace("MAPI")

  Set fldFolder = olNS.GetDefaultFolder(olFolderContacts).Parent

For Each SubFolder In fldFolder.Folders
If SubFolder.DefaultItemType = olContactItem Then

Debug.Print SubFolder.Name
SubFolder.ShowAsOutlookAB = True
End If

Next SubFolder

Set SubFolder = Nothing

ExitSub:
End Sub
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
K outlook workflow: automated task generation Outlook VBA and Custom Forms 4
Harald Olsen Automated insertion of address in address line Using Outlook 1
G How do I create a custom pick list in VB for an outlook automated email? Outlook VBA and Custom Forms 1
M Outlook 2003 Add-in automated removal Using Outlook 9
S Automated way to move messages to a non-outlokk folder - saves as Outlook VBA and Custom Forms 1
P turn off the default "all day" check box in new calendar items. How? Using Outlook 1
L Help: set flag for sent mail to check if received an answer Outlook VBA and Custom Forms 2
Witzker Outlook 2019 Macro to check Cursor & Focus position Outlook VBA and Custom Forms 8
CWM550 Saving Data: Don't check certain folders Using Outlook 2
D Spell check Outlook VBA and Custom Forms 3
L Spell-check dictionary confusion Using Outlook 0
S How to export urls from email to excel and check the status of the url ? Using Outlook 5
N Private check box in table view Using Outlook 0
S Outlook to check for specific text Outlook VBA and Custom Forms 3
C Custom Outlook Form - Populate Information from Radio Button / Check Box Using Outlook 0
O Outlook 2016 This rule will only run when you check your email in Outlook.... Using Outlook 4
A Check for words in subject header before sending email Outlook VBA and Custom Forms 4
R Using "check for duplicates" for existing contacts Using Outlook 2
P Suppress dialog box on email check error? Using Outlook 5
Potty Ash MS Outlook 2010 custom form - validation or formula to request user to check a checkbox Outlook VBA and Custom Forms 16
I Check if sent email has been replied Outlook VBA and Custom Forms 1
K adding more rules to 'different domains check' macro Outlook VBA and Custom Forms 2
R Macro to check file name with outlook address book Outlook VBA and Custom Forms 0
Diane Poremsky Check Contacts before moving them to Hotmail Contacts folder Using Outlook 0
Diane Poremsky Check for missing attachments before sending a message Using Outlook 1
R Outlook 2010 Modify Style "Do not check spelling or grammar" not saving Outlook VBA and Custom Forms 0
K check for sender, follow to my personal adress and delete the sent folder. Outlook VBA and Custom Forms 1
J Send and Receive Button - only check default account? Using Outlook 1
A Check for attachment code not working Outlook VBA and Custom Forms 1
Diane Poremsky Check Message Size Before Sending Using Outlook 0
B Check for different domains macro to be triggered by specific domains only Outlook VBA and Custom Forms 2
V Check/convert to emailaddresses Outlook VBA and Custom Forms 11
JorgeDario how to check a MailItem has a digital signature (SMIME) with vba? Outlook VBA and Custom Forms 1
O Unable to check name. Using Outlook 3
R Outlook Custom form check if there an attachment Outlook VBA and Custom Forms 2
L Trying to check for the absence of mail. Outlook VBA and Custom Forms 1
S Check if two organisition is added then i have to give managers passward creteria to send mail Using Outlook 1
Peter H Williams check for new email automaticlly Using Outlook 12
C Unusual Signature & Spell Check Query Using Outlook 1
M Calendar navigation displays previous field records.check calendar is shared.. Using Outlook 3
A Can Rule Check Category Contact is assigned? Using Outlook 1
T Outlook 2007 forms: Check boxes and free text boxes not retaining data Using Outlook 1
L check if send message appears in SendItems forder before moving Using Outlook 0
C Create a rule to only check new content in email - disregard original content Using Outlook 3
M Outlook Rules check for new line character Using Outlook 1
G Outlook rule check for messages not received Outlook VBA and Custom Forms 2
E Outlook could not create the work file. Check the temp environment variable Using Outlook 8
B Custom real time, time format check Outlook VBA and Custom Forms 1
B BCM shuts down everytime I try to import/export or check for error BCM (Business Contact Manager) 10
D Check whether mail item is proper for sending or not Outlook VBA and Custom Forms 5

Similar threads

Back
Top