Je veux envoyé des informations dans contacts de Outlook. Les contacts sont
situés dans un répertoire public.
J'ai trouvé un bout de programmation qui fonctionne avec les contacts du
répertoire par défaut ( GetDefaultFolder(olFolderContacts).Items). Je
n'arrive a modifier la programmation pour aller dans le répertoire désiré
(EBR Contacts)
Merci
Robert
Dim Cn As ADODB.Connection
Dim rst As New ADODB.Recordset
Dim objOutlook As Outlook.Application
Dim objNameSpace As Outlook.NameSpace
Dim colItems As Items
Dim upContactId As UserProperty
Dim strMessage As String
Dim objPublicFolders As Object
Dim objFavoritesFolder As Object
Dim objEBRContacts As Object
Set Cn = CurrentProject.Connection
rst.Open "SELECT * FROM tblContact WHERE dblContactLineID = '" &
Me!cboContactLineID & "' ", Cn, adOpenKeyset, adLockOptimistic
'Get a reference to the Items collection of the contacts folder.
Set objOutlook = New Outlook.Application
Set objNameSpace = objOutlook.GetNamespace("MAPI")
Set objPublicFolders = objNameSpace.Folders("Public Folders")
Set objFavoritesFolder = objPublicFolders.Folders("All Public Folders")
Set objEBRContacts = objFavoritesFolder.Folders("EBR Contacts").Items
' Set colItems.objOutlook.GetNamespace("MAPI") _
' GetDefaultFolder(olFolderContacts).Items
' Do Until tblContacts.EOF
If boolCheckName(Nz(rst!strFirstName & " " & rst!strLastName), objNameSpace)
Then
'Use the Add method of Items collection to fill in the
'fields with the data from the table and then save the new
'item.
With objNameSpace.Add
.FullName = Nz(rst!strFirstName & " " & rst!strLastName)
' .BusinessAddressStreet = Nz(rst!Address)
' .BusinessAddressCity = Nz(tblContacts!city)
' .BusinessAddressState = Nz(tblContacts!region)
' .BusinessAddressPostalCode = Nz(tblContacts!PostalCode)
' .BusinessAddressCountry = Nz(tblContacts!country)
' .BusinessTelephoneNumber = Nz(tblContacts!Phone)
' .BusinessFaxNumber = Nz(tblContacts!Fax)
' .CompanyName = Nz(tblContacts!CompanyName)
.JobTitle = Nz("Test")
'Create a custom field.
Set upContactId = .UserProperties. _
Add("ContactID", olText)
upContactId = Nz(rst!dblContactLineID)
.Save
End With
End If
rst.Close
Set rst = Nothing
Je veux envoyé des informations dans contacts de Outlook. Les contacts sont
situés dans un répertoire public.
J'ai trouvé un bout de programmation qui fonctionne avec les contacts du
répertoire par défaut ( GetDefaultFolder(olFolderContacts).Items). Je
n'arrive a modifier la programmation pour aller dans le répertoire désiré
(EBR Contacts)
Merci
Robert
Dim Cn As ADODB.Connection
Dim rst As New ADODB.Recordset
Dim objOutlook As Outlook.Application
Dim objNameSpace As Outlook.NameSpace
Dim colItems As Items
Dim upContactId As UserProperty
Dim strMessage As String
Dim objPublicFolders As Object
Dim objFavoritesFolder As Object
Dim objEBRContacts As Object
Set Cn = CurrentProject.Connection
rst.Open "SELECT * FROM tblContact WHERE dblContactLineID = '" &
Me!cboContactLineID & "' ", Cn, adOpenKeyset, adLockOptimistic
'Get a reference to the Items collection of the contacts folder.
Set objOutlook = New Outlook.Application
Set objNameSpace = objOutlook.GetNamespace("MAPI")
Set objPublicFolders = objNameSpace.Folders("Public Folders")
Set objFavoritesFolder = objPublicFolders.Folders("All Public Folders")
Set objEBRContacts = objFavoritesFolder.Folders("EBR Contacts").Items
' Set colItems.objOutlook.GetNamespace("MAPI") _
' GetDefaultFolder(olFolderContacts).Items
' Do Until tblContacts.EOF
If boolCheckName(Nz(rst!strFirstName & " " & rst!strLastName), objNameSpace)
Then
'Use the Add method of Items collection to fill in the
'fields with the data from the table and then save the new
'item.
With objNameSpace.Add
.FullName = Nz(rst!strFirstName & " " & rst!strLastName)
' .BusinessAddressStreet = Nz(rst!Address)
' .BusinessAddressCity = Nz(tblContacts!city)
' .BusinessAddressState = Nz(tblContacts!region)
' .BusinessAddressPostalCode = Nz(tblContacts!PostalCode)
' .BusinessAddressCountry = Nz(tblContacts!country)
' .BusinessTelephoneNumber = Nz(tblContacts!Phone)
' .BusinessFaxNumber = Nz(tblContacts!Fax)
' .CompanyName = Nz(tblContacts!CompanyName)
.JobTitle = Nz("Test")
'Create a custom field.
Set upContactId = .UserProperties. _
Add("ContactID", olText)
upContactId = Nz(rst!dblContactLineID)
.Save
End With
End If
rst.Close
Set rst = Nothing
Je veux envoyé des informations dans contacts de Outlook. Les contacts sont
situés dans un répertoire public.
J'ai trouvé un bout de programmation qui fonctionne avec les contacts du
répertoire par défaut ( GetDefaultFolder(olFolderContacts).Items). Je
n'arrive a modifier la programmation pour aller dans le répertoire désiré
(EBR Contacts)
Merci
Robert
Dim Cn As ADODB.Connection
Dim rst As New ADODB.Recordset
Dim objOutlook As Outlook.Application
Dim objNameSpace As Outlook.NameSpace
Dim colItems As Items
Dim upContactId As UserProperty
Dim strMessage As String
Dim objPublicFolders As Object
Dim objFavoritesFolder As Object
Dim objEBRContacts As Object
Set Cn = CurrentProject.Connection
rst.Open "SELECT * FROM tblContact WHERE dblContactLineID = '" &
Me!cboContactLineID & "' ", Cn, adOpenKeyset, adLockOptimistic
'Get a reference to the Items collection of the contacts folder.
Set objOutlook = New Outlook.Application
Set objNameSpace = objOutlook.GetNamespace("MAPI")
Set objPublicFolders = objNameSpace.Folders("Public Folders")
Set objFavoritesFolder = objPublicFolders.Folders("All Public Folders")
Set objEBRContacts = objFavoritesFolder.Folders("EBR Contacts").Items
' Set colItems.objOutlook.GetNamespace("MAPI") _
' GetDefaultFolder(olFolderContacts).Items
' Do Until tblContacts.EOF
If boolCheckName(Nz(rst!strFirstName & " " & rst!strLastName), objNameSpace)
Then
'Use the Add method of Items collection to fill in the
'fields with the data from the table and then save the new
'item.
With objNameSpace.Add
.FullName = Nz(rst!strFirstName & " " & rst!strLastName)
' .BusinessAddressStreet = Nz(rst!Address)
' .BusinessAddressCity = Nz(tblContacts!city)
' .BusinessAddressState = Nz(tblContacts!region)
' .BusinessAddressPostalCode = Nz(tblContacts!PostalCode)
' .BusinessAddressCountry = Nz(tblContacts!country)
' .BusinessTelephoneNumber = Nz(tblContacts!Phone)
' .BusinessFaxNumber = Nz(tblContacts!Fax)
' .CompanyName = Nz(tblContacts!CompanyName)
.JobTitle = Nz("Test")
'Create a custom field.
Set upContactId = .UserProperties. _
Add("ContactID", olText)
upContactId = Nz(rst!dblContactLineID)
.Save
End With
End If
rst.Close
Set rst = Nothing
Bonjour !
Essaie avec
GetDefaultFolder(olPublicFoldersAllPublicFolders).Folders("EBR Contacts")
A+
Isa
"Robert Parise" a écrit dans le message de news:XwtFd.5249$Je veux envoyé des informations dans contacts de Outlook. Les contacts sont
situés dans un répertoire public.
J'ai trouvé un bout de programmation qui fonctionne avec les contacts du
répertoire par défaut ( GetDefaultFolder(olFolderContacts).Items). Je
n'arrive a modifier la programmation pour aller dans le répertoire désiré
(EBR Contacts)
Merci
Robert
Dim Cn As ADODB.Connection
Dim rst As New ADODB.Recordset
Dim objOutlook As Outlook.Application
Dim objNameSpace As Outlook.NameSpace
Dim colItems As Items
Dim upContactId As UserProperty
Dim strMessage As String
Dim objPublicFolders As Object
Dim objFavoritesFolder As Object
Dim objEBRContacts As Object
Set Cn = CurrentProject.Connection
rst.Open "SELECT * FROM tblContact WHERE dblContactLineID = '" &
Me!cboContactLineID & "' ", Cn, adOpenKeyset, adLockOptimistic
'Get a reference to the Items collection of the contacts folder.
Set objOutlook = New Outlook.Application
Set objNameSpace = objOutlook.GetNamespace("MAPI")
Set objPublicFolders = objNameSpace.Folders("Public Folders")
Set objFavoritesFolder = objPublicFolders.Folders("All Public Folders")
Set objEBRContacts = objFavoritesFolder.Folders("EBR Contacts").Items
' Set colItems.objOutlook.GetNamespace("MAPI") _
' GetDefaultFolder(olFolderContacts).Items
' Do Until tblContacts.EOF
If boolCheckName(Nz(rst!strFirstName & " " & rst!strLastName), objNameSpace)
Then
'Use the Add method of Items collection to fill in the
'fields with the data from the table and then save the new
'item.
With objNameSpace.Add
.FullName = Nz(rst!strFirstName & " " & rst!strLastName)
' .BusinessAddressStreet = Nz(rst!Address)
' .BusinessAddressCity = Nz(tblContacts!city)
' .BusinessAddressState = Nz(tblContacts!region)
' .BusinessAddressPostalCode = Nz(tblContacts!PostalCode)
' .BusinessAddressCountry = Nz(tblContacts!country)
' .BusinessTelephoneNumber = Nz(tblContacts!Phone)
' .BusinessFaxNumber = Nz(tblContacts!Fax)
' .CompanyName = Nz(tblContacts!CompanyName)
.JobTitle = Nz("Test")
'Create a custom field.
Set upContactId = .UserProperties. _
Add("ContactID", olText)
upContactId = Nz(rst!dblContactLineID)
.Save
End With
End If
rst.Close
Set rst = Nothing
Bonjour !
Essaie avec
GetDefaultFolder(olPublicFoldersAllPublicFolders).Folders("EBR Contacts")
A+
Isa
"Robert Parise" <robert.parise@videotron.ca> a écrit dans le message de news:XwtFd.5249$UT4.30855@wagner.videotron.net...
Je veux envoyé des informations dans contacts de Outlook. Les contacts sont
situés dans un répertoire public.
J'ai trouvé un bout de programmation qui fonctionne avec les contacts du
répertoire par défaut ( GetDefaultFolder(olFolderContacts).Items). Je
n'arrive a modifier la programmation pour aller dans le répertoire désiré
(EBR Contacts)
Merci
Robert
Dim Cn As ADODB.Connection
Dim rst As New ADODB.Recordset
Dim objOutlook As Outlook.Application
Dim objNameSpace As Outlook.NameSpace
Dim colItems As Items
Dim upContactId As UserProperty
Dim strMessage As String
Dim objPublicFolders As Object
Dim objFavoritesFolder As Object
Dim objEBRContacts As Object
Set Cn = CurrentProject.Connection
rst.Open "SELECT * FROM tblContact WHERE dblContactLineID = '" &
Me!cboContactLineID & "' ", Cn, adOpenKeyset, adLockOptimistic
'Get a reference to the Items collection of the contacts folder.
Set objOutlook = New Outlook.Application
Set objNameSpace = objOutlook.GetNamespace("MAPI")
Set objPublicFolders = objNameSpace.Folders("Public Folders")
Set objFavoritesFolder = objPublicFolders.Folders("All Public Folders")
Set objEBRContacts = objFavoritesFolder.Folders("EBR Contacts").Items
' Set colItems.objOutlook.GetNamespace("MAPI") _
' GetDefaultFolder(olFolderContacts).Items
' Do Until tblContacts.EOF
If boolCheckName(Nz(rst!strFirstName & " " & rst!strLastName), objNameSpace)
Then
'Use the Add method of Items collection to fill in the
'fields with the data from the table and then save the new
'item.
With objNameSpace.Add
.FullName = Nz(rst!strFirstName & " " & rst!strLastName)
' .BusinessAddressStreet = Nz(rst!Address)
' .BusinessAddressCity = Nz(tblContacts!city)
' .BusinessAddressState = Nz(tblContacts!region)
' .BusinessAddressPostalCode = Nz(tblContacts!PostalCode)
' .BusinessAddressCountry = Nz(tblContacts!country)
' .BusinessTelephoneNumber = Nz(tblContacts!Phone)
' .BusinessFaxNumber = Nz(tblContacts!Fax)
' .CompanyName = Nz(tblContacts!CompanyName)
.JobTitle = Nz("Test")
'Create a custom field.
Set upContactId = .UserProperties. _
Add("ContactID", olText)
upContactId = Nz(rst!dblContactLineID)
.Save
End With
End If
rst.Close
Set rst = Nothing
Bonjour !
Essaie avec
GetDefaultFolder(olPublicFoldersAllPublicFolders).Folders("EBR Contacts")
A+
Isa
"Robert Parise" a écrit dans le message de news:XwtFd.5249$Je veux envoyé des informations dans contacts de Outlook. Les contacts sont
situés dans un répertoire public.
J'ai trouvé un bout de programmation qui fonctionne avec les contacts du
répertoire par défaut ( GetDefaultFolder(olFolderContacts).Items). Je
n'arrive a modifier la programmation pour aller dans le répertoire désiré
(EBR Contacts)
Merci
Robert
Dim Cn As ADODB.Connection
Dim rst As New ADODB.Recordset
Dim objOutlook As Outlook.Application
Dim objNameSpace As Outlook.NameSpace
Dim colItems As Items
Dim upContactId As UserProperty
Dim strMessage As String
Dim objPublicFolders As Object
Dim objFavoritesFolder As Object
Dim objEBRContacts As Object
Set Cn = CurrentProject.Connection
rst.Open "SELECT * FROM tblContact WHERE dblContactLineID = '" &
Me!cboContactLineID & "' ", Cn, adOpenKeyset, adLockOptimistic
'Get a reference to the Items collection of the contacts folder.
Set objOutlook = New Outlook.Application
Set objNameSpace = objOutlook.GetNamespace("MAPI")
Set objPublicFolders = objNameSpace.Folders("Public Folders")
Set objFavoritesFolder = objPublicFolders.Folders("All Public Folders")
Set objEBRContacts = objFavoritesFolder.Folders("EBR Contacts").Items
' Set colItems.objOutlook.GetNamespace("MAPI") _
' GetDefaultFolder(olFolderContacts).Items
' Do Until tblContacts.EOF
If boolCheckName(Nz(rst!strFirstName & " " & rst!strLastName), objNameSpace)
Then
'Use the Add method of Items collection to fill in the
'fields with the data from the table and then save the new
'item.
With objNameSpace.Add
.FullName = Nz(rst!strFirstName & " " & rst!strLastName)
' .BusinessAddressStreet = Nz(rst!Address)
' .BusinessAddressCity = Nz(tblContacts!city)
' .BusinessAddressState = Nz(tblContacts!region)
' .BusinessAddressPostalCode = Nz(tblContacts!PostalCode)
' .BusinessAddressCountry = Nz(tblContacts!country)
' .BusinessTelephoneNumber = Nz(tblContacts!Phone)
' .BusinessFaxNumber = Nz(tblContacts!Fax)
' .CompanyName = Nz(tblContacts!CompanyName)
.JobTitle = Nz("Test")
'Create a custom field.
Set upContactId = .UserProperties. _
Add("ContactID", olText)
upContactId = Nz(rst!dblContactLineID)
.Save
End With
End If
rst.Close
Set rst = Nothing
Bonjour !
Essaie avec
GetDefaultFolder(olPublicFoldersAllPublicFolders).Folders("EBR Contacts")
A+
Isa
"Robert Parise" a écrit dans le message de
news:XwtFd.5249$Je veux envoyé des informations dans contacts de Outlook. Les contacts
sont
situés dans un répertoire public.
J'ai trouvé un bout de programmation qui fonctionne avec les contacts du
répertoire par défaut ( GetDefaultFolder(olFolderContacts).Items). Je
n'arrive a modifier la programmation pour aller dans le répertoire désiré
(EBR Contacts)
Merci
Robert
Dim Cn As ADODB.Connection
Dim rst As New ADODB.Recordset
Dim objOutlook As Outlook.Application
Dim objNameSpace As Outlook.NameSpace
Dim colItems As Items
Dim upContactId As UserProperty
Dim strMessage As String
Dim objPublicFolders As Object
Dim objFavoritesFolder As Object
Dim objEBRContacts As Object
Set Cn = CurrentProject.Connection
rst.Open "SELECT * FROM tblContact WHERE dblContactLineID = '" &
Me!cboContactLineID & "' ", Cn, adOpenKeyset, adLockOptimistic
'Get a reference to the Items collection of the contacts folder.
Set objOutlook = New Outlook.Application
Set objNameSpace = objOutlook.GetNamespace("MAPI")
Set objPublicFolders = objNameSpace.Folders("Public Folders")
Set objFavoritesFolder = objPublicFolders.Folders("All Public Folders")
Set objEBRContacts = objFavoritesFolder.Folders("EBR Contacts").Items
' Set colItems.objOutlook.GetNamespace("MAPI") _
' GetDefaultFolder(olFolderContacts).Items
' Do Until tblContacts.EOF
If boolCheckName(Nz(rst!strFirstName & " " & rst!strLastName),
objNameSpace)
Then
'Use the Add method of Items collection to fill in the
'fields with the data from the table and then save the new
'item.
With objNameSpace.Add
.FullName = Nz(rst!strFirstName & " " & rst!strLastName)
' .BusinessAddressStreet = Nz(rst!Address)
' .BusinessAddressCity = Nz(tblContacts!city)
' .BusinessAddressState = Nz(tblContacts!region)
' .BusinessAddressPostalCode =
Nz(tblContacts!PostalCode)
' .BusinessAddressCountry = Nz(tblContacts!country)
' .BusinessTelephoneNumber = Nz(tblContacts!Phone)
' .BusinessFaxNumber = Nz(tblContacts!Fax)
' .CompanyName = Nz(tblContacts!CompanyName)
.JobTitle = Nz("Test")
'Create a custom field.
Set upContactId = .UserProperties. _
Add("ContactID", olText)
upContactId = Nz(rst!dblContactLineID)
.Save
End With
End If
rst.Close
Set rst = Nothing
Bonjour !
Essaie avec
GetDefaultFolder(olPublicFoldersAllPublicFolders).Folders("EBR Contacts")
A+
Isa
"Robert Parise" <robert.parise@videotron.ca> a écrit dans le message de
news:XwtFd.5249$UT4.30855@wagner.videotron.net...
Je veux envoyé des informations dans contacts de Outlook. Les contacts
sont
situés dans un répertoire public.
J'ai trouvé un bout de programmation qui fonctionne avec les contacts du
répertoire par défaut ( GetDefaultFolder(olFolderContacts).Items). Je
n'arrive a modifier la programmation pour aller dans le répertoire désiré
(EBR Contacts)
Merci
Robert
Dim Cn As ADODB.Connection
Dim rst As New ADODB.Recordset
Dim objOutlook As Outlook.Application
Dim objNameSpace As Outlook.NameSpace
Dim colItems As Items
Dim upContactId As UserProperty
Dim strMessage As String
Dim objPublicFolders As Object
Dim objFavoritesFolder As Object
Dim objEBRContacts As Object
Set Cn = CurrentProject.Connection
rst.Open "SELECT * FROM tblContact WHERE dblContactLineID = '" &
Me!cboContactLineID & "' ", Cn, adOpenKeyset, adLockOptimistic
'Get a reference to the Items collection of the contacts folder.
Set objOutlook = New Outlook.Application
Set objNameSpace = objOutlook.GetNamespace("MAPI")
Set objPublicFolders = objNameSpace.Folders("Public Folders")
Set objFavoritesFolder = objPublicFolders.Folders("All Public Folders")
Set objEBRContacts = objFavoritesFolder.Folders("EBR Contacts").Items
' Set colItems.objOutlook.GetNamespace("MAPI") _
' GetDefaultFolder(olFolderContacts).Items
' Do Until tblContacts.EOF
If boolCheckName(Nz(rst!strFirstName & " " & rst!strLastName),
objNameSpace)
Then
'Use the Add method of Items collection to fill in the
'fields with the data from the table and then save the new
'item.
With objNameSpace.Add
.FullName = Nz(rst!strFirstName & " " & rst!strLastName)
' .BusinessAddressStreet = Nz(rst!Address)
' .BusinessAddressCity = Nz(tblContacts!city)
' .BusinessAddressState = Nz(tblContacts!region)
' .BusinessAddressPostalCode =
Nz(tblContacts!PostalCode)
' .BusinessAddressCountry = Nz(tblContacts!country)
' .BusinessTelephoneNumber = Nz(tblContacts!Phone)
' .BusinessFaxNumber = Nz(tblContacts!Fax)
' .CompanyName = Nz(tblContacts!CompanyName)
.JobTitle = Nz("Test")
'Create a custom field.
Set upContactId = .UserProperties. _
Add("ContactID", olText)
upContactId = Nz(rst!dblContactLineID)
.Save
End With
End If
rst.Close
Set rst = Nothing
Bonjour !
Essaie avec
GetDefaultFolder(olPublicFoldersAllPublicFolders).Folders("EBR Contacts")
A+
Isa
"Robert Parise" a écrit dans le message de
news:XwtFd.5249$Je veux envoyé des informations dans contacts de Outlook. Les contacts
sont
situés dans un répertoire public.
J'ai trouvé un bout de programmation qui fonctionne avec les contacts du
répertoire par défaut ( GetDefaultFolder(olFolderContacts).Items). Je
n'arrive a modifier la programmation pour aller dans le répertoire désiré
(EBR Contacts)
Merci
Robert
Dim Cn As ADODB.Connection
Dim rst As New ADODB.Recordset
Dim objOutlook As Outlook.Application
Dim objNameSpace As Outlook.NameSpace
Dim colItems As Items
Dim upContactId As UserProperty
Dim strMessage As String
Dim objPublicFolders As Object
Dim objFavoritesFolder As Object
Dim objEBRContacts As Object
Set Cn = CurrentProject.Connection
rst.Open "SELECT * FROM tblContact WHERE dblContactLineID = '" &
Me!cboContactLineID & "' ", Cn, adOpenKeyset, adLockOptimistic
'Get a reference to the Items collection of the contacts folder.
Set objOutlook = New Outlook.Application
Set objNameSpace = objOutlook.GetNamespace("MAPI")
Set objPublicFolders = objNameSpace.Folders("Public Folders")
Set objFavoritesFolder = objPublicFolders.Folders("All Public Folders")
Set objEBRContacts = objFavoritesFolder.Folders("EBR Contacts").Items
' Set colItems.objOutlook.GetNamespace("MAPI") _
' GetDefaultFolder(olFolderContacts).Items
' Do Until tblContacts.EOF
If boolCheckName(Nz(rst!strFirstName & " " & rst!strLastName),
objNameSpace)
Then
'Use the Add method of Items collection to fill in the
'fields with the data from the table and then save the new
'item.
With objNameSpace.Add
.FullName = Nz(rst!strFirstName & " " & rst!strLastName)
' .BusinessAddressStreet = Nz(rst!Address)
' .BusinessAddressCity = Nz(tblContacts!city)
' .BusinessAddressState = Nz(tblContacts!region)
' .BusinessAddressPostalCode =
Nz(tblContacts!PostalCode)
' .BusinessAddressCountry = Nz(tblContacts!country)
' .BusinessTelephoneNumber = Nz(tblContacts!Phone)
' .BusinessFaxNumber = Nz(tblContacts!Fax)
' .CompanyName = Nz(tblContacts!CompanyName)
.JobTitle = Nz("Test")
'Create a custom field.
Set upContactId = .UserProperties. _
Add("ContactID", olText)
upContactId = Nz(rst!dblContactLineID)
.Save
End With
End If
rst.Close
Set rst = Nothing
Je n'y arrive toujours pas
Pourriez-vous corriger le code ci-dessous et me le faire parvenir
Merci
Robert
"Isabelle Prawitz" a écrit dans le message de news:
O2evKpW%Bonjour !
Essaie avec
GetDefaultFolder(olPublicFoldersAllPublicFolders).Folders("EBR Contacts")
A+
Isa
"Robert Parise" a écrit dans le message de
news:XwtFd.5249$Je veux envoyé des informations dans contacts de Outlook. Les contacts
sont
situés dans un répertoire public.
J'ai trouvé un bout de programmation qui fonctionne avec les contacts du
répertoire par défaut ( GetDefaultFolder(olFolderContacts).Items). Je
n'arrive a modifier la programmation pour aller dans le répertoire désiré
(EBR Contacts)
Merci
Robert
Dim Cn As ADODB.Connection
Dim rst As New ADODB.Recordset
Dim objOutlook As Outlook.Application
Dim objNameSpace As Outlook.NameSpace
Dim colItems As Items
Dim upContactId As UserProperty
Dim strMessage As String
Dim objPublicFolders As Object
Dim objFavoritesFolder As Object
Dim objEBRContacts As Object
Set Cn = CurrentProject.Connection
rst.Open "SELECT * FROM tblContact WHERE dblContactLineID = '" &
Me!cboContactLineID & "' ", Cn, adOpenKeyset, adLockOptimistic
'Get a reference to the Items collection of the contacts folder.
Set objOutlook = New Outlook.Application
Set objNameSpace = objOutlook.GetNamespace("MAPI")
Set objPublicFolders = objNameSpace.Folders("Public Folders")
Set objFavoritesFolder = objPublicFolders.Folders("All Public Folders")
Set objEBRContacts = objFavoritesFolder.Folders("EBR Contacts").Items
' Set colItems.objOutlook.GetNamespace("MAPI") _
' GetDefaultFolder(olFolderContacts).Items
' Do Until tblContacts.EOF
If boolCheckName(Nz(rst!strFirstName & " " & rst!strLastName),
objNameSpace)
Then
'Use the Add method of Items collection to fill in the
'fields with the data from the table and then save the new
'item.
With objNameSpace.Add
.FullName = Nz(rst!strFirstName & " " & rst!strLastName)
' .BusinessAddressStreet = Nz(rst!Address)
' .BusinessAddressCity = Nz(tblContacts!city)
' .BusinessAddressState = Nz(tblContacts!region)
' .BusinessAddressPostalCode > >> Nz(tblContacts!PostalCode)
' .BusinessAddressCountry = Nz(tblContacts!country)
' .BusinessTelephoneNumber = Nz(tblContacts!Phone)
' .BusinessFaxNumber = Nz(tblContacts!Fax)
' .CompanyName = Nz(tblContacts!CompanyName)
.JobTitle = Nz("Test")
'Create a custom field.
Set upContactId = .UserProperties. _
Add("ContactID", olText)
upContactId = Nz(rst!dblContactLineID)
.Save
End With
End If
rst.Close
Set rst = Nothing
Je n'y arrive toujours pas
Pourriez-vous corriger le code ci-dessous et me le faire parvenir
Merci
Robert
"Isabelle Prawitz" <iprawitz@wanadoo.fr> a écrit dans le message de news:
O2evKpW%23EHA.2196@TK2MSFTNGP11.phx.gbl...
Bonjour !
Essaie avec
GetDefaultFolder(olPublicFoldersAllPublicFolders).Folders("EBR Contacts")
A+
Isa
"Robert Parise" <robert.parise@videotron.ca> a écrit dans le message de
news:XwtFd.5249$UT4.30855@wagner.videotron.net...
Je veux envoyé des informations dans contacts de Outlook. Les contacts
sont
situés dans un répertoire public.
J'ai trouvé un bout de programmation qui fonctionne avec les contacts du
répertoire par défaut ( GetDefaultFolder(olFolderContacts).Items). Je
n'arrive a modifier la programmation pour aller dans le répertoire désiré
(EBR Contacts)
Merci
Robert
Dim Cn As ADODB.Connection
Dim rst As New ADODB.Recordset
Dim objOutlook As Outlook.Application
Dim objNameSpace As Outlook.NameSpace
Dim colItems As Items
Dim upContactId As UserProperty
Dim strMessage As String
Dim objPublicFolders As Object
Dim objFavoritesFolder As Object
Dim objEBRContacts As Object
Set Cn = CurrentProject.Connection
rst.Open "SELECT * FROM tblContact WHERE dblContactLineID = '" &
Me!cboContactLineID & "' ", Cn, adOpenKeyset, adLockOptimistic
'Get a reference to the Items collection of the contacts folder.
Set objOutlook = New Outlook.Application
Set objNameSpace = objOutlook.GetNamespace("MAPI")
Set objPublicFolders = objNameSpace.Folders("Public Folders")
Set objFavoritesFolder = objPublicFolders.Folders("All Public Folders")
Set objEBRContacts = objFavoritesFolder.Folders("EBR Contacts").Items
' Set colItems.objOutlook.GetNamespace("MAPI") _
' GetDefaultFolder(olFolderContacts).Items
' Do Until tblContacts.EOF
If boolCheckName(Nz(rst!strFirstName & " " & rst!strLastName),
objNameSpace)
Then
'Use the Add method of Items collection to fill in the
'fields with the data from the table and then save the new
'item.
With objNameSpace.Add
.FullName = Nz(rst!strFirstName & " " & rst!strLastName)
' .BusinessAddressStreet = Nz(rst!Address)
' .BusinessAddressCity = Nz(tblContacts!city)
' .BusinessAddressState = Nz(tblContacts!region)
' .BusinessAddressPostalCode > >> Nz(tblContacts!PostalCode)
' .BusinessAddressCountry = Nz(tblContacts!country)
' .BusinessTelephoneNumber = Nz(tblContacts!Phone)
' .BusinessFaxNumber = Nz(tblContacts!Fax)
' .CompanyName = Nz(tblContacts!CompanyName)
.JobTitle = Nz("Test")
'Create a custom field.
Set upContactId = .UserProperties. _
Add("ContactID", olText)
upContactId = Nz(rst!dblContactLineID)
.Save
End With
End If
rst.Close
Set rst = Nothing
Je n'y arrive toujours pas
Pourriez-vous corriger le code ci-dessous et me le faire parvenir
Merci
Robert
"Isabelle Prawitz" a écrit dans le message de news:
O2evKpW%Bonjour !
Essaie avec
GetDefaultFolder(olPublicFoldersAllPublicFolders).Folders("EBR Contacts")
A+
Isa
"Robert Parise" a écrit dans le message de
news:XwtFd.5249$Je veux envoyé des informations dans contacts de Outlook. Les contacts
sont
situés dans un répertoire public.
J'ai trouvé un bout de programmation qui fonctionne avec les contacts du
répertoire par défaut ( GetDefaultFolder(olFolderContacts).Items). Je
n'arrive a modifier la programmation pour aller dans le répertoire désiré
(EBR Contacts)
Merci
Robert
Dim Cn As ADODB.Connection
Dim rst As New ADODB.Recordset
Dim objOutlook As Outlook.Application
Dim objNameSpace As Outlook.NameSpace
Dim colItems As Items
Dim upContactId As UserProperty
Dim strMessage As String
Dim objPublicFolders As Object
Dim objFavoritesFolder As Object
Dim objEBRContacts As Object
Set Cn = CurrentProject.Connection
rst.Open "SELECT * FROM tblContact WHERE dblContactLineID = '" &
Me!cboContactLineID & "' ", Cn, adOpenKeyset, adLockOptimistic
'Get a reference to the Items collection of the contacts folder.
Set objOutlook = New Outlook.Application
Set objNameSpace = objOutlook.GetNamespace("MAPI")
Set objPublicFolders = objNameSpace.Folders("Public Folders")
Set objFavoritesFolder = objPublicFolders.Folders("All Public Folders")
Set objEBRContacts = objFavoritesFolder.Folders("EBR Contacts").Items
' Set colItems.objOutlook.GetNamespace("MAPI") _
' GetDefaultFolder(olFolderContacts).Items
' Do Until tblContacts.EOF
If boolCheckName(Nz(rst!strFirstName & " " & rst!strLastName),
objNameSpace)
Then
'Use the Add method of Items collection to fill in the
'fields with the data from the table and then save the new
'item.
With objNameSpace.Add
.FullName = Nz(rst!strFirstName & " " & rst!strLastName)
' .BusinessAddressStreet = Nz(rst!Address)
' .BusinessAddressCity = Nz(tblContacts!city)
' .BusinessAddressState = Nz(tblContacts!region)
' .BusinessAddressPostalCode > >> Nz(tblContacts!PostalCode)
' .BusinessAddressCountry = Nz(tblContacts!country)
' .BusinessTelephoneNumber = Nz(tblContacts!Phone)
' .BusinessFaxNumber = Nz(tblContacts!Fax)
' .CompanyName = Nz(tblContacts!CompanyName)
.JobTitle = Nz("Test")
'Create a custom field.
Set upContactId = .UserProperties. _
Add("ContactID", olText)
upContactId = Nz(rst!dblContactLineID)
.Save
End With
End If
rst.Close
Set rst = Nothing