[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.6

Sending Contacts to Exchange Public Folder

Asked by TheCannibalizer in Microsoft Access Database

Tags: contacts, from, update

I have the following code that exports contacts from my table 'main' to my default outlook contact folder.
I need to accomplish two things here.
1 - To update contacts rather than duplicating when running the function multiple times
2 - To send the contacts to a specified public folder rather than the default contact folder.

Dim dbs As Database
   Dim rst As Recordset
   Dim objOutlook As Outlook.Application
   Dim nms As Outlook.NameSpace
   Dim flds As Outlook.Folders
   Dim fldcontacts As Outlook.MAPIFolder
   'Dim fldContacts As Object
   Dim itms As Object
   Dim itm As Object
   Dim strCompany As String
   Dim strBusinessStreet As String
   Dim strBusinessStreet2 As String
   Dim strBusinessCity As String
   Dim strBusinessState As String
   Dim strBusinessZip As String
   Dim strBusinessPhone As String
   Dim strBusinessFax As String
   Dim strCategory As String
   Dim strCRLF As String
   Dim lngCount As Long
   Dim strID As String
     
   strCRLF = Chr$(13) & Chr$(10)
   
   Set objOutlook = CreateObject("Outlook.Application")
   Set nms = objOutlook.GetNamespace("MAPI")
   'Set fldcontacts = ("public folders/all public folders/streeter contacts")
   Set fldcontacts = nms.GetDefaultFolder(olFolderContacts)
   Set itms = fldcontacts.Items
   
   'Get reference to data table
   Set dbs = CurrentDb
   Set rst = dbs![Main].OpenRecordset(dbOpenTable, dbDenyRead)
   lngCount = rst.RecordCount
   MsgBox lngCount & " records to transfer to Outlook"

   'Loop through table, exporting each record to Outlook
   Do Until rst.EOF
      With rst
         'Pick up data from a record
         strCompany = Nz(![Company])
         strBusinessStreet = Nz(![BusinessStreet])
         strBusinessCity = Nz(![BusinessCity])
         strBusinessState = Nz(![BusinessState])
         strBusinessZip = Nz(![BusinessZip])
         strBusinessPhone = Nz(![BusinessPhone])
         strBusinessFax = Nz(![BusinessFax])
         strCategory = Nz(![Category])
         
      End With
     
      'Create a contact item
      Set itm = itms.Add("IPM.Contact")

     
      With itm
         .CompanyName = strCompany
         .BusinessAddressStreet = strBusinessStreet
         .BusinessAddressCity = strBusinessCity
         .BusinessAddressState = strBusinessState
         .BusinessAddressPostalCode = strBusinessZip
         .BusinessTelephoneNumber = strBusinessPhone
         .BusinessFaxNumber = strBusinessFax
         .Categories = strCategory
         .Close (olSave)
         DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
      End With
   rst.MoveNext
   Loop
   
   MsgBox "All Contacts exported!"
   
Exit_cmdPushData_Click:
   Exit Sub

Err_cmdPushData_Click:
   MsgBox Err.Description
   Resume Exit_cmdPushData_Click
End Sub

Any help is appreciated.
[+][-]12/28/05 11:06 AM, ID: 15564767Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/28/05 12:44 PM, ID: 15565556Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12/29/05 05:30 AM, ID: 15570173Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/29/05 06:20 AM, ID: 15570430Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12/29/05 06:25 AM, ID: 15570463Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12/29/05 06:39 AM, ID: 15570555Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/29/05 06:53 AM, ID: 15570666Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12/29/05 07:03 AM, ID: 15570755Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: Microsoft Access Database
Tags: contacts, from, update
Sign Up Now!
Solution Provided By: stevbe
Participating Experts: 1
Solution Grade: A
 
[+][-]12/29/05 07:48 AM, ID: 15571106Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-89