Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 6th, 2004, 10:58 AM
Registered User
 
Join Date: Apr 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Access & Outlook

Hello

In Access it is possible to relate or/and import a table from Outlook(like Contacts).
So now I have found out how to connect to Outlook an all, but I have no clue how to make the same connection as Access does, when I do it manually.
That means that after importing the Contacts, a change in the Outlook will not change my Access table, because its a copy - Access has another way to connect to Outlook, it even shows up an Outlook Exchange symbol..
((In Access)for this make a right klick(in the window which shows the tables), then choose relate table(I have a german version, don't really know how it is called in english),
choose the filetype "Outlook()" - then use the wizard.)


Thanks; sorry for the text, my native language isn't english, so I try to explain sometimes to long, other times to short. lol :-)
 
Old April 7th, 2004, 08:31 AM
Registered User
 
Join Date: Apr 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Talking to myself
Where I found it:
http://msdn.microsoft.com/library/de...olexcoutlk.asp
What I needed:
Sub OutlookLink()
    Dim dbs As database
    Dim tdf As TableDef
    Dim str As String
    Const conTableExists = 3012
    On Error GoTo Link_Err
    Set dbs = CurrentDb
    str = "Outlook 9.0;MAPILEVEL=Öffentliche Ordner|Alle Öffentlichen Ordner\Bau- Umwelt- und Wirtschaftsdepartement\Raumentwicklung, Wirtschaftsförderung und Geoinformation\Geoinformation\;" _
         & "TABLETYPE=0;" _
         & "DATABASE=C:\DOKUME~1\dmathis\LOKALE~1\Temp\" & dbs.Name & ";" '_
         '& "PROFILE=David;PWD=Cisco;"
     Set tdf = dbs.CreateTableDef("Outlook Contacts")
    tdf.Connect = str
    tdf.SourceTableName = "allg. Kontakte/Verteilerlisten"
    dbs.TableDefs.Append tdf
    RefreshDatabaseWindow

Link_Exit:
    dbs.Close
    Set dbs = Nothing
Exit Sub

Link_Err:
    If Err = conTableExists Then
        MsgBox "Die Tabelle Outlook Contacts existiert bereits."
        Resume Link_Exit
    Else
        MsgBox "Error: " & Err.Number & ": " & Err.Description
    End If
End Sub





Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook Automation in Access arielalevy Access VBA 1 June 27th, 2006 07:00 PM
Need help w/ "WITHEVENTS" & the Outlook Obj ArtDecade VB How-To 1 October 27th, 2004 03:50 AM
ASP & Outlook Web Access jolo98 Classic ASP Basics 0 October 8th, 2004 04:43 AM
Linking Outlook and Access John Anthony Access VBA 1 August 12th, 2003 10:04 AM
Loading Images & Interact with Outlook wasaan SQL Server ASP 1 August 4th, 2003 06:35 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.