Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Outlook Contact Info

I need to populate a few cells in a sheet based on the current open Outlook
Contact. Any snippets would be appreciated.

Thanks,
Rick Slaugh


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 599
Default Outlook Contact Info

Rick

Here's some general information about automating Outlook

http://www.dicks-clicks.com/excel/olAutomating.htm

For you specific question, here's some example code

Sub GetContact()

Dim olApp As Outlook.Application
Dim olNs As NameSpace
Dim olCi As Object

On Error Resume Next
Set olApp = GetObject(, "Outlook.Application")

If Err.Number = 429 Then
Set olApp = CreateObject("Outlook.Application")
End If

On Error GoTo 0

Set olNs = olApp.GetNamespace("MAPI")

If Not olApp.ActiveInspector Is Nothing Then
Set olCi = olApp.ActiveInspector.CurrentItem

If TypeName(olCi) = "ContactItem" Then
Sheet1.Range("A1").Value = olCi.FullName
Sheet1.Range("a2").Value = olCi.BusinessTelephoneNumber
End If
End If

Set olNs = Nothing
Set olApp = Nothing

End Sub

--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.

"Rick Slaugh" wrote in message
...
I need to populate a few cells in a sheet based on the current open

Outlook
Contact. Any snippets would be appreciated.

Thanks,
Rick Slaugh




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I move contact info from excell to Outlook? Jynene Excel Discussion (Misc queries) 1 April 15th 10 10:52 PM
Create Outlook Contact from Excel Eric Excel Discussion (Misc queries) 3 November 7th 07 03:24 AM
Outlook contact info link to Excel HDStig Excel Worksheet Functions 0 January 22nd 07 11:16 PM
Exporting contact info to Outlook 2003 200grandprix Excel Discussion (Misc queries) 0 April 25th 06 08:06 PM
open outlook contact Martin Excel Discussion (Misc queries) 0 May 4th 05 05:48 PM


All times are GMT +1. The time now is 04:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"