none
How to get a list of Outlook Contacts in my MS-Word VSTO Project? RRS feed

  • Question

  • Hi,
    I am trying to use this function (https://www.add-in-express.com/creating-addins-blog/2011/10/21/outlook-retrieve-contact-items/?thank=you&t=1547544899#comment-545844) in my VSTO Project (Visual Studio 2017 and Office 365).
    I would like to call the function from MS-Word via a Ribbon Toolbar to get a List of Outlook contacts from my local MS-Outlook contacts Folder.
    (Later on I would like to insert the address data to my Word-Document..)

    Unfortunatelly I get some errors if I use your solution:

    First I added "Microsoft.Office.Interop." before each Outlook. - call because I got "Type Oulook.Items is not defined"..

    Then I made the function public not private

    Now If I call the function in my Ribbon.vb:
    Globals.ThisAddIn.Getoutlookcontacts(Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderSuggestedContacts)
    I get "olFoldersuggestedContacts is cannot be converted to MAPI folder"..
    Any ideas?

    thanks,

    Andreas

    Tuesday, January 15, 2019 9:40 AM