Solved

connecting to outlook folders

Posted on 2002-04-06
6
486 Views
Last Modified: 2010-05-19
I found the following article on MS KB but I can't see how it'll work.  first I don't have an icon in control panel called mail tool. nor do I have a tab called delivery.

How do I get this to work.?

MS KB Article

Click Start , point to Settings , and then click Control Panel .


In Control Panel, open the Mail tool.


Click the Delivery tab to see the list of available mailboxes. Your mailbox name is in the Deliver new mail to the following location box.


In an Access database, create a new module, and then paste or type the following code.

NOTE : In the connection string, change the name James Smith to your mailbox name, and make sure the path to the Temp folder is correct for your system. Keep in mind that the spaces, the minus sign, and the vertical bar character are required in the string.


Sub OpenExchange_ContactFolder()
    Dim ADOConn As ADODB.Connection
    Dim ADORS As ADODB.Recordset
    Dim strConn As String
   
    Set ADOConn = New ADODB.Connection
    Set ADORS = New ADODB.Recordset
       
    With ADOConn
        .Provider = "Microsoft.JET.OLEDB.4.0"
        .ConnectionString = "Exchange 4.0;" _
                            & "MAPILEVEL=Mailbox - James Smith|;" _
                            & "PROFILE=MS Exchange Settings;" _
                            & "TABLETYPE=0;DATABASE=C:\WINDOWS\TEMP\;"
        .Open
    End With
   
    With ADORS
        .Open "Select * from Contacts", ADOConn, adOpenStatic, _
               adLockReadOnly
        .MoveFirst
            Debug.Print ADORS(0).Name, ADORS(0).Value
            Debug.Print ADORS(1).Name, ADORS(1).Value
        .Close
    End With
   
    Set ADORS = Nothing
    ADOConn.Close
    Set ADOConn = Nothing

End Sub
0
Comment
Question by:SE081398
  • 3
  • 3
6 Comments
 
LVL 9

Expert Comment

by:ornicar
Comment Utility
This code seems to work with Exchange, which fortunately you don't have installed. ;-)

With Access 2000, you can directly link Outlook tables.
With Access 97, there is a wizard you can download here:

Import and Link Exchange/Outlook Wizards for Access 97
http://office.microsoft.com/downloads/9798/Wzmapi.aspx

If you prefer to tweak with code, you will have to open the tables a different way, by using the outlook application object.



0
 
LVL 3

Author Comment

by:SE081398
Comment Utility
I'm using 2000, so the 97 mapi addin won't work.  Do you have some code that works with 2000.  I'm looking for some samples that I can play with to get the idea.  I've found a few others since posting this Q and I'm looking through them all.  Your input would be much appreciated.

 

0
 
LVL 9

Accepted Solution

by:
ornicar earned 100 total points
Comment Utility
With Access 2000, you can directly link Outlook tables:
File menu, get external data, link tables.
Choose Outlook() for the type of file.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 3

Author Comment

by:SE081398
Comment Utility
well that was easy hey.  thanks

would you happen to have any code that would do this as well.

 
0
 
LVL 9

Expert Comment

by:ornicar
Comment Utility
Take a look at these EE questions, all related to manage Outlook data from Access:

http://www.experts-exchange.com/questions/Q.20228467.html
http://www.experts-exchange.com/questions/Q.20222514.html
http://www.experts-exchange.com/questions/Q.20168793.html
http://www.experts-exchange.com/questions/Q.20157857.html
http://www.experts-exchange.com/questions/Q.20151746.html

If you search for 'Outlook' in the knowledge base, you can see that there are a lot of unanswered questions. I feel its because it is easier to solve the problem by the other end: Search for 'database' or something else in the Outlook topic.
0
 
LVL 3

Author Comment

by:SE081398
Comment Utility
Thanks.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now