(Solved) – Automation add contacts to favourite folder using VBA in Outlook

(solved)-–-automation-add-contacts-to-favourite-folder-using-vba-in-outlook

I’m trying to create a script for adding automatically contacts to a favorite folder because this is the default and customers don’t want to change it.
I’m trying to change this but without success changed “GroupDiscussion” to “Contacts”

Sub AddToFavorites()
    'Adds a Public Folder to the list of favorites
    Dim olapp As Outlook.Application
    Dim objFolder As Outlook.MAPIFolder
    Set olapp = New Outlook.Application
    Set objFolder = 
    olapp.Session.GetDefaultFolder(olPublicFoldersAllPublicFolders).Folders.Item("GroupDiscussion")
    objFolder.AddToPFFavorites
End Sub

Leave a Reply

Your email address will not be published. Required fields are marked *