Solved

connecting to outlook folders

Posted on 2002-04-06
6
490 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
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
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 
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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
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…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
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.

770 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