+ Reply to Thread
Results 1 to 4 of 4

Can I create a static link between Excel and Outlook contact data.

  1. #1
    Bokeltri
    Guest

    Can I create a static link between Excel and Outlook contact data.

    I have contact information in my excel spreadsheet that I update manually. I
    would like to link these fields to my Outlook cantact data instead. Can this
    be done and how?

  2. #2
    galimi
    Guest

    RE: Can I create a static link between Excel and Outlook contact data.

    You can link to data in Outlook from Excel using VBA and navigating through
    the Outlook Object Model.

    I have posted an example file to http://www.Galimi.com/Examples/Outlook.xls

    Following is the code that should be enough to complete what you wish to
    accomplish:

    http://HelpExcel.com

    Sub getOutlook()
    Set myOLAPP = CreateObject("Outlook.Application")
    'Dim myOLAPP As New Outlook.Application


    Set mynamespace = myOLAPP.GetNamespace("MAPI")
    Set myAddressList = mynamespace.Folders(1).Folders(6).Items

    For Each strItem In myAddressList
    shtImport.Range("a2").Offset(r) = strItem.FirstName
    shtImport.Range("b2").Offset(r) = strItem.LastName
    r = r + 1

    Next


    Set oOL = Nothing
    End Sub


    "Bokeltri" wrote:

    > I have contact information in my excel spreadsheet that I update manually. I
    > would like to link these fields to my Outlook cantact data instead. Can this
    > be done and how?


  3. #3
    Bokeltri
    Guest

    RE: Can I create a static link between Excel and Outlook contact d

    Something isn't working correctly in the example spreadsheet. (1) When I
    open your sreadsheet, there is a complie error for the Macro adveriseME. The
    "ie =" is highlighted and the message is "can't find project or library". (2)
    when I run GetOutlook the "MyOlapp =" is highlighted and the error says can't
    find project or library. Any suggestions?


    "galimi" wrote:

    > You can link to data in Outlook from Excel using VBA and navigating through
    > the Outlook Object Model.
    >
    > I have posted an example file to http://www.Galimi.com/Examples/Outlook.xls
    >
    > Following is the code that should be enough to complete what you wish to
    > accomplish:
    >
    > http://HelpExcel.com
    >
    > Sub getOutlook()
    > Set myOLAPP = CreateObject("Outlook.Application")
    > 'Dim myOLAPP As New Outlook.Application
    >
    >
    > Set mynamespace = myOLAPP.GetNamespace("MAPI")
    > Set myAddressList = mynamespace.Folders(1).Folders(6).Items
    >
    > For Each strItem In myAddressList
    > shtImport.Range("a2").Offset(r) = strItem.FirstName
    > shtImport.Range("b2").Offset(r) = strItem.LastName
    > r = r + 1
    >
    > Next
    >
    >
    > Set oOL = Nothing
    > End Sub
    >
    >
    > "Bokeltri" wrote:
    >
    > > I have contact information in my excel spreadsheet that I update manually. I
    > > would like to link these fields to my Outlook cantact data instead. Can this
    > > be done and how?


  4. #4
    galimi
    Guest

    RE: Can I create a static link between Excel and Outlook contact d

    In the project, set a reference for Outlook or replace

    dim ie as new Outlook

    with

    set ie = createobject("Outlook.Application")

    The latter will allow you to connect to Outlook without setting a reference

    http://HelpExcel.com

    "Bokeltri" wrote:

    > Something isn't working correctly in the example spreadsheet. (1) When I
    > open your sreadsheet, there is a complie error for the Macro adveriseME. The
    > "ie =" is highlighted and the message is "can't find project or library". (2)
    > when I run GetOutlook the "MyOlapp =" is highlighted and the error says can't
    > find project or library. Any suggestions?
    >
    >
    > "galimi" wrote:
    >
    > > You can link to data in Outlook from Excel using VBA and navigating through
    > > the Outlook Object Model.
    > >
    > > I have posted an example file to http://www.Galimi.com/Examples/Outlook.xls
    > >
    > > Following is the code that should be enough to complete what you wish to
    > > accomplish:
    > >
    > > http://HelpExcel.com
    > >
    > > Sub getOutlook()
    > > Set myOLAPP = CreateObject("Outlook.Application")
    > > 'Dim myOLAPP As New Outlook.Application
    > >
    > >
    > > Set mynamespace = myOLAPP.GetNamespace("MAPI")
    > > Set myAddressList = mynamespace.Folders(1).Folders(6).Items
    > >
    > > For Each strItem In myAddressList
    > > shtImport.Range("a2").Offset(r) = strItem.FirstName
    > > shtImport.Range("b2").Offset(r) = strItem.LastName
    > > r = r + 1
    > >
    > > Next
    > >
    > >
    > > Set oOL = Nothing
    > > End Sub
    > >
    > >
    > > "Bokeltri" wrote:
    > >
    > > > I have contact information in my excel spreadsheet that I update manually. I
    > > > would like to link these fields to my Outlook cantact data instead. Can this
    > > > be done and how?


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1