Photos contact outlook via access

BLONDAWWW -  
incaout Messages postés 347 Date d'inscription   Statut Membre Dernière intervention   -
Bonjour,
je voudrai savoir si il est possible de modifier la photos d'un contact outlook via une ligne de code vba access

j'explique:

en gros quand je clique sur un bouton je voudrai modifier la photo d'un contact ou meme si c'est possible que ça se face a une date précise

est ce que c'est possible d'après vous? je cherche sur le web mais sans résultat

merci
Configuration: Windows XP
Firefox 3.5.1

3 réponses

  1. incaout Messages postés 347 Date d'inscription   Statut Membre Dernière intervention   74
     
    Bonjour,

    Je pense que cela doit être possible en utilisant l'automation, c'est à dire demander à Access de piloter outlook en créant dans Access un environnement outlook afin de pouvoir accéder aux objets de type contact dans outlook et modifier leur propriété.

    Quelle version de Access et outlook utilises tu ?

    Cdlt

    IC
    0
  2. BLONDAWWW
     
    merci de me repondre j'ai trouve ce code sur internet qui est intéréssant je v le modifier a ma façon merci beaucoup

    The following Microsoft Visual Basic for Applications (VBA) example prompts the user to specify the name of a contact and the file name containing a picture of the contact, and then adds the picture to the contact item. If a picture already exists for the contact item, the example prompts the user to specify if the existing picture should be overwritten by the new file.

    Sub AddPictureToAContact()
    Dim myOlApp As Outlook.Application
    Dim myNms As Outlook.NameSpace
    Dim myFolder As Outlook.MAPIFolder
    Dim myContactItem As Outlook.ContactItem
    Dim strName As String
    Dim strPath As String
    Dim strPrompt As String
    Set myOlApp = CreateObject("Outlook.Application")

    Set myNms = myOlApp.GetNamespace("MAPI")
    Set myFolder = myNms.GetDefaultFolder(olFolderContacts)

    strName = InputBox("Type the name of the contact: ")

    Set myContactItem = myFolder.Items(strName)

    If myContactItem.HasPicture = True Then
    strPrompt = MsgBox("The contact already has a picture associated with it. Do you want to overwrite the existing picture?", vbYesNo)

    If strPrompt = vbNo Then
    Exit Sub
    End If
    End If

    strPath = InputBox("Type the file name for the contact: ")
    myContactItem.AddPicture (strPath)
    myContactItem.Save
    myContactItem.Display

    End Sub
    0
  3. incaout Messages postés 347 Date d'inscription   Statut Membre Dernière intervention   74
     
    ok. Cela me parait être une bonne base.

    N'oublies pas d'ajouter dans VBA sous Access la bibliothèque pour Outlook.

    Menu Outil--> Références.

    Cdlt

    IC
    0