none
Enregistrer un contact outlook 2013 a partir d'une application windev RRS feed

  • Question

  • Bonjour 

    Je cherche à créer/modifier/enregistrer des contacts outlook 2013 a partir d'une appli windev 20. 

    J'arrive a importer tous les contacts vers un fichier HFSQL avec le code ci-dessous. 

    // ---------------------------------------
    // Copie les contacts outlook dans le fichier HF
    // ----------------------------------------
    
    
    objApp est un objet OLE dynamique
    objNS est un objet OLE dynamique
    myFolder1 est un objet OLE dynamique
    Ocontact est un objet OLE dynamique
    
    NomBAL est une chaîne
    NomBAL = "xxxxxxx@xxxxx.com"
    
    NomDossierdecontact est une chaîne
    NomDossierdecontact = "TEST_WINDEV"
    
    NBContact est un entier
    i est un entier=1
    
    objApp=ObjetActif("OutLook.Application")
    objNS=objApp>>GetNamespace("MAPI")
    
    //Récuperer le dossier contact de votre choix
    //myFolder1=objNS>>PickFolder
    myFolder1=objNS>>folders(NomBAL)>>folders(NomDossierdecontact)
    
    // Nombre de contact dans le dossier selectionné
    NBContact = myFolder1>>items>>count
    //Trace(NBContact)
    
    // Fenetre de progression du traitement
    nIndice est un entier
    OuvreFille(FenetreJauge)
    POUR nIndice = 1 A 100
    	FenetreJauge.Progression(nIndice,NBContact) 
    	
    FIN
    Ferme(FenetreJauge)
    
    TANTQUE i<=NBContact
    	Ocontact=myFolder1>>items(i)	
    	//Assistant
    	Tb_contacts.AssistantName = Ocontact>>AssistantName
    	Tb_contacts.AssistantTelephoneNumber = Ocontact>>AssistantTelephoneNumber
    	
    	//adresse societé
    	Tb_contacts.BusinessAddress = Ocontact>>BusinessAddress
    	Tb_contacts.BusinessAddressCity = Ocontact>>BusinessAddressCity
    	Tb_contacts.BusinessAddressCountry = Ocontact>>BusinessAddressCountry
    	Tb_contacts.BusinessAddressPostalCode = Ocontact>>BusinessAddressPostalCode
    	Tb_contacts.BusinessAddressPostOfficeBox = Ocontact>>BusinessAddressPostOfficeBox
    	Tb_contacts.BusinessAddressState = Ocontact>>BusinessAddressState
    	Tb_contacts.BusinessAddressStreet = Ocontact>>BusinessAddressStreet
    	
    	//société
    	Tb_contacts.CompanyMainTelephoneNumber = Ocontact>>CompanyMainTelephoneNumber
    	Tb_contacts.CompanyName = Ocontact>>CompanyName
    	Tb_contacts.Companies = Ocontact>>Companies
    	
    	// adresse emails
    	Tb_contacts.Email1Address = Ocontact>>Email1Address
    	Tb_contacts.Email1AddressType = Ocontact>>Email1AddressType
    	Tb_contacts.Email1DisplayName = Ocontact>>Email1DisplayName
    	
    	Tb_contacts.Email2Address = Ocontact>>Email2Address
    	Tb_contacts.Email2AddressType = Ocontact>>Email2AddressType
    	Tb_contacts.Email2DisplayName = Ocontact>>Email2DisplayName
    	
    	Tb_contacts.Email3Address = Ocontact>>Email3Address
    	Tb_contacts.Email3AddressType = Ocontact>>Email3AddressType
    	Tb_contacts.Email3DisplayName = Ocontact>>Email3DisplayName
    	
    	//domicile
    	Tb_contacts.HomeAddress = Ocontact>>HomeAddress
    	Tb_contacts.Home2TelephoneNumber = Ocontact>>Home2TelephoneNumber
    	Tb_contacts.HomeAddressCity = Ocontact>>HomeAddressCity
    	Tb_contacts.HomeAddressCountry = Ocontact>>HomeAddressCountry
    	Tb_contacts.HomeAddressPostalCode = Ocontact>>HomeAddressPostalCode
    	Tb_contacts.HomeAddressPostOfficeBox = Ocontact>>HomeAddressPostOfficeBox
    	Tb_contacts.HomeAddressState = Ocontact>>HomeAddressState
    	Tb_contacts.HomeAddressStreet = Ocontact>>HomeAddressStreet
    	Tb_contacts.HomeFaxNumber = Ocontact>>HomeFaxNumber
    	Tb_contacts.HomeTelephoneNumber = Ocontact>>HomeTelephoneNumber
    	
    	//Mailing	
    	Tb_contacts.MailingAddress = Ocontact>>MailingAddress
    	Tb_contacts.MailingAddressCity = Ocontact>>MailingAddressCity
    	Tb_contacts.MailingAddressCountry = Ocontact>>MailingAddressCountry
    	Tb_contacts.MailingAddressPostalCode = Ocontact>>MailingAddressPostalCode
    	Tb_contacts.MailingAddressPostOfficeBox = Ocontact>>MailingAddressPostOfficeBox
    	Tb_contacts.MailingAddressState = Ocontact>>MailingAddressState
    	Tb_contacts.MailingAddressStreet = Ocontact>>MailingAddressStreet
    	
    	//Netmeeting
    	Tb_contacts.NetMeetingAlias = Ocontact>>NetMeetingAlias
    	Tb_contacts.NetMeetingServer = Ocontact>>NetMeetingServer
    	
    	//Others
    	Tb_contacts.OtherAddress = Ocontact>>OtherAddress
    	Tb_contacts.OtherAddressCity = Ocontact>>OtherAddressCity
    	Tb_contacts.OtherAddressCountry = Ocontact>>OtherAddressCountry
    	Tb_contacts.OtherAddressPostalCode = Ocontact>>OtherAddressPostalCode
    	Tb_contacts.OtherAddressPostOfficeBox = Ocontact>>OtherAddressPostOfficeBox
    	Tb_contacts.OtherAddressState = Ocontact>>OtherAddressState
    	Tb_contacts.OtherAddressStreet = Ocontact>>OtherAddressStreet
    	Tb_contacts.OtherFaxNumber = Ocontact>>OtherFaxNumber
    	Tb_contacts.OtherTelephoneNumber = Ocontact>>OtherTelephoneNumber
    	
    	//Yomi
    	Tb_contacts.YomiCompanyName = Ocontact>>YomiCompanyName
    	Tb_contacts.YomiFirstName = Ocontact>>YomiFirstName
    	Tb_contacts.YomiLastName = Ocontact>>YomiLastName
    	
    	//Détails
    	Tb_contacts.Account = Ocontact>>Account
    	Tb_contacts.Anniversary = RéelVersDateHeure(Ocontact>>Anniversary)
    	
    	Tb_contacts.AssistantName = Ocontact>>AssistantName
    	Tb_contacts.AssistantTelephoneNumber = Ocontact>>AssistantTelephoneNumber
    	Tb_contacts.BillingInformation = Ocontact>>BillingInformation
    	Tb_contacts.Birthday = RéelVersDateHeure(Ocontact>>Birthday)
    	Tb_contacts.Body = Ocontact>>Body
    	Tb_contacts.CallbackTelephoneNumber = Ocontact>>CallbackTelephoneNumber
    	Tb_contacts.CarTelephoneNumber = Ocontact>>CarTelephoneNumber
    	Tb_contacts.Categories = Ocontact>>Categories
    	Tb_contacts.Children = Ocontact>>Children
    	Tb_contacts.CreationTime = RéelVersDateHeure(Ocontact>>CreationTime)
    	Tb_contacts.CustomerID = Ocontact>>CustomerID
    	
    	Tb_contacts.Department = Ocontact>>Department
    	Tb_contacts.FTPSite = Ocontact>>FTPSite
    	Tb_contacts.FullName = Ocontact>>FullName
    	Tb_contacts.Gender = Ocontact>>Gender
    	Tb_contacts.GovernmentIDNumber = Ocontact>>GovernmentIDNumber
    	Tb_contacts.Hobby = Ocontact>>Hobby
    	Tb_contacts.IMAddress = Ocontact>>IMAddress
    	Tb_contacts.Importance = Ocontact>>Importance
    	Tb_contacts.Initials = Ocontact>>Initials
    	Tb_contacts.InternetFreeBusyAddress = Ocontact>>InternetFreeBusyAddress
    	Tb_contacts.ISDNNumber = Ocontact>>ISDNNumber
    	Tb_contacts.JobTitle = Ocontact>>JobTitle
    	Tb_contacts.Language = Ocontact>>Language
    	
    	
    	Tb_contacts.ManagerName = Ocontact>>ManagerName
    	Tb_contacts.MiddleName = Ocontact>>MiddleName
    	Tb_contacts.Mileage = Ocontact>>Mileage
    	Tb_contacts.NickName = Ocontact>>NickName
    	Tb_contacts.OfficeLocation = Ocontact>>OfficeLocation
    	Tb_contacts.OrganizationalIDNumber = Ocontact>>OrganizationalIDNumber
    	Tb_contacts.PagerNumber = Ocontact>>PagerNumber
    	Tb_contacts.PersonalHomePage = Ocontact>>PersonalHomePage
    	Tb_contacts.PrimaryTelephoneNumber = Ocontact>>PrimaryTelephoneNumber
    	Tb_contacts.Profession = Ocontact>>Profession
    	Tb_contacts.RadioTelephoneNumber = Ocontact>>RadioTelephoneNumber
    	Tb_contacts.ReferredBy = Ocontact>>ReferredBy
    	Tb_contacts.Spouse = Ocontact>>Spouse
    	Tb_contacts.Suffix = Ocontact>>Suffix
    	Tb_contacts.TelexNumber = Ocontact>>TelexNumber
    	Tb_contacts.Title = Ocontact>>Title
    	Tb_contacts.TTYTDDTelephoneNumber = Ocontact>>TTYTDDTelephoneNumber
    	Tb_contacts.User1 = Ocontact>>User1
    	Tb_contacts.User2 = Ocontact>>User2
    	Tb_contacts.User3 = Ocontact>>User3
    	Tb_contacts.User4 = Ocontact>>User4
    	Tb_contacts.WebPage = Ocontact>>WebPage
    	
    	
    	
    	
    	Tb_contacts.EntryID = Ocontact>>EntryID
    	Tb_contacts.LastModificationTime = RéelVersDateHeure(Ocontact>>LastModificationTime)
    	Tb_contacts.FirstName = Ocontact>>FirstName
    	Tb_contacts.LastName = Ocontact>>LastName
    	
    	
    	
    		
    		SI PAS HAjoute(Tb_contacts) ALORS 
    		Erreur("Erreur HAjoute" + HErreur())
    	FIN
    	//Trace (Tb_contacts.LastName)
    	i++
    	FIN
    	
    TableAffiche(Table_contacts,taRéExecuteRequete)

    Si je modifies un contact, j'aimerai mettre a jour le contact dans outlook... 

    Comment doit on faire ?

    Merci 

    lundi 1 juin 2015 13:54

Réponses