Solved

connecting to outlook folders

Posted on 2002-04-06
6
492 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 9

Expert Comment

by:ornicar
ID: 6924350
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
ID: 6924484
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
ID: 6924825
With Access 2000, you can directly link Outlook tables:
File menu, get external data, link tables.
Choose Outlook() for the type of file.
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 3

Author Comment

by:SE081398
ID: 6925454
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
ID: 6925673
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
ID: 6925816
Thanks.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

756 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