Bonjour tt le monde

j'ai rencontré un problème bizzare c'est que j'ai un code qui permet d'extraire les contacts Outlook et ça marche trés bien sur mon poste mais sur une autre non plus.

il m donne une erreur au niveau de namespace

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
Imports Microsoft.Office.Interop

 Dim oContact As Outlook.ContactItem
            Dim myFolder As Outlook.Folder
            Dim myOlApp As Outlook.Application
            Dim myNamespace As Outlook.NameSpace

            myOlApp = CreateObject("Outlook.Application") 'New Outlook.Application
            myNamespace = myOlApp.GetNamespace("MAPI")
            myFolder = myNamespace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts)

Erreur:

Unable to cast COM object of type 'Microsoft.Office.Interop.Outlook.ApplicationClass' to interface type 'Microsoft.Office.Interop.Outlook._Application'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{00063001-0000-0000-C000-000000000046}' failed due to the following error: Library not registered. (Exception from HRESULT:
0x8002801D (TYPE_E_LIBNOTREGISTERED)).

et j'obtient la même erreur si je met myNamespace = myOlApp.session

svp une idée
merci d'avance