Bonjour a tous!
Je suis entrain d'écrire un code qui va aller chercher dans outlook un de mes contacts par rapport a son full name
voilà le code :
Tout marche bien jusqu'à qu'il tombe sur un contact avec un " ' " comme " L'agence de dupont"
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 Dim accountsFolder As Outlook.Folder = DirectCast(bcmRootFolder.Folders("Comptes"), Outlook.Folder) Dim strQuery As String = "[FullName] = " & "'" & dr("NOMCLIENT") & " " & dr("PRENOMCLIENT") & "'" Dim accountItem As Outlook.ContactItem = DirectCast(accountsFolder.Items.Find(strQuery), Outlook.ContactItem) Dim EntryID As String = accountItem.EntryID 'Affectation a un compte If newOpportunity.UserProperties("Parent Entity EntryID") Is Nothing Then Dim userProp As Outlook.UserProperty = newOpportunity.UserProperties.Add("Parent Entity EntryID", Microsoft.Office.Interop.Outlook.OlUserPropertyType.olText, False, False) userProp.Value = EntryID End If
vue que l'apostrophe il va le voir comme une fin de chaîne.
quelqu'un peut il me dire comment rentrer mes champs "NOMCLIENT" & "PRENOMCLIENT" pour pas que j'ai cette erreur? merci
Partager