Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
FSTC892
 
Posts: n/a
Default How do I enter Outlook contact data into excel?

I create sales quotes to customers in Excel. I want to be able to lookup the
customer contact information that is already in Outlook while working in
Excel and automatically copy or enter that contact information into my sales
quote in Excel. Is this possible?
  #2   Report Post  
Michael
 
Posts: n/a
Default

Hi FSTC892.
The only way I can think of you doing that is to first export your contacts
folder to a .csv file and then open it with excel. Export is on the File
Menu. Maybe one of the MVP's knows a better way. HTH
--
Sincerely, Michael Colvin


"FSTC892" wrote:

I create sales quotes to customers in Excel. I want to be able to lookup the
customer contact information that is already in Outlook while working in
Excel and automatically copy or enter that contact information into my sales
quote in Excel. Is this possible?

  #3   Report Post  
Steve Yandl
 
Posts: n/a
Default

It's possible but you might have to do some tweaking to get exactly what you
want.

The function and subroutine below is one I use to populate sheet(1) with
first name, last name, and email address. I keep postal address info in
Access but this could be expanded to extract the info from any of the fields
you use in Outlook. I also suspect that you want some sort of form with a
drop down list of Contacts which can also be done but would be a bit of
work, especially not knowing exactly how you want the whole thing to work.
Hope this gives you a decent head start. I suspect some will have routines
closer to what you want.

Public olApp As Outlook.Application
Public olNS As Outlook.NameSpace


Function InitOutlook() As Boolean
On Error GoTo Init_Error
Set olApp = New Outlook.Application
Set olNS = olApp.GetNamespace("MAPI")

InitOutlook = True

Init_End:
Exit Function
Init_Error:
InitOutlook = False
Resume Init_End
End Function

Sub ContactGrab()
Dim fdContacts As Outlook.MAPIFolder
Dim fdItems As Outlook.Items
Dim fdItem As Object
Dim R As Integer

If olApp Is Nothing Then
If InitOutlook = False Then
MsgBox "Unable to initialize Outlook application or namespace"
Exit Sub
End If
End If

Set fdContacts = olNS.GetDefaultFolder(olFolderContacts)
Set fdItems = fdContacts.Items

Sheets("Sheet1").UsedRange.Clear

R = 1
With Sheets("Sheet1")
.Rows("1").Font.Bold = True
.Cells(1, 1).Value = "Contacts First Name"
.Cells(1, 2).Value = "Contacts Last Name"
.Cells(1, 3).Value = "Contacts Email Address"
.Columns("A").ColumnWidth = 32
.Columns("B").ColumnWidth = 36
.Columns("C").ColumnWidth = 26

End With

For Each fdItem In fdItems
On Error Resume Next
R = R + 1
With Sheets("Sheet1")
.Cells(R, 1).Value = fdItem.FirstName
.Cells(R, 2).Value = fdItem.LastName
.Cells(R, 3).Value = fdItem.Email1Address
End With
Next

End Sub


Steve



"FSTC892" wrote in message
...
I create sales quotes to customers in Excel. I want to be able to lookup
the
customer contact information that is already in Outlook while working in
Excel and automatically copy or enter that contact information into my
sales
quote in Excel. Is this possible?



  #4   Report Post  
Frank Parker
 
Posts: n/a
Default

Hi Steve,
Thankyou for the solution that I am looking for, however, I do not have an
idea how to use the info you have provided. Could you give further
instruction on how to insert a contact?

"Steve Yandl" wrote:

It's possible but you might have to do some tweaking to get exactly what you
want.

The function and subroutine below is one I use to populate sheet(1) with
first name, last name, and email address. I keep postal address info in
Access but this could be expanded to extract the info from any of the fields
you use in Outlook. I also suspect that you want some sort of form with a
drop down list of Contacts which can also be done but would be a bit of
work, especially not knowing exactly how you want the whole thing to work.
Hope this gives you a decent head start. I suspect some will have routines
closer to what you want.

Public olApp As Outlook.Application
Public olNS As Outlook.NameSpace


Function InitOutlook() As Boolean
On Error GoTo Init_Error
Set olApp = New Outlook.Application
Set olNS = olApp.GetNamespace("MAPI")

InitOutlook = True

Init_End:
Exit Function
Init_Error:
InitOutlook = False
Resume Init_End
End Function

Sub ContactGrab()
Dim fdContacts As Outlook.MAPIFolder
Dim fdItems As Outlook.Items
Dim fdItem As Object
Dim R As Integer

If olApp Is Nothing Then
If InitOutlook = False Then
MsgBox "Unable to initialize Outlook application or namespace"
Exit Sub
End If
End If

Set fdContacts = olNS.GetDefaultFolder(olFolderContacts)
Set fdItems = fdContacts.Items

Sheets("Sheet1").UsedRange.Clear

R = 1
With Sheets("Sheet1")
.Rows("1").Font.Bold = True
.Cells(1, 1).Value = "Contacts First Name"
.Cells(1, 2).Value = "Contacts Last Name"
.Cells(1, 3).Value = "Contacts Email Address"
.Columns("A").ColumnWidth = 32
.Columns("B").ColumnWidth = 36
.Columns("C").ColumnWidth = 26

End With

For Each fdItem In fdItems
On Error Resume Next
R = R + 1
With Sheets("Sheet1")
.Cells(R, 1).Value = fdItem.FirstName
.Cells(R, 2).Value = fdItem.LastName
.Cells(R, 3).Value = fdItem.Email1Address
End With
Next

End Sub


Steve



"FSTC892" wrote in message
...
I create sales quotes to customers in Excel. I want to be able to lookup
the
customer contact information that is already in Outlook while working in
Excel and automatically copy or enter that contact information into my
sales
quote in Excel. Is this possible?




  #5   Report Post  
Frank Parker
 
Posts: n/a
Default

Hi Steve
Second question?
I inserted your language into a macro and tried to run it. I got the
following error:
Compile error. User defined type not defined.

I am sorry but I am a novice when it comes to Visual Basic.

I assume the problem is that the macro does not know where my contact info
is located. How do I resolve this problem?

"Steve Yandl" wrote:

It's possible but you might have to do some tweaking to get exactly what you
want.

The function and subroutine below is one I use to populate sheet(1) with
first name, last name, and email address. I keep postal address info in
Access but this could be expanded to extract the info from any of the fields
you use in Outlook. I also suspect that you want some sort of form with a
drop down list of Contacts which can also be done but would be a bit of
work, especially not knowing exactly how you want the whole thing to work.
Hope this gives you a decent head start. I suspect some will have routines
closer to what you want.

Public olApp As Outlook.Application
Public olNS As Outlook.NameSpace


Function InitOutlook() As Boolean
On Error GoTo Init_Error
Set olApp = New Outlook.Application
Set olNS = olApp.GetNamespace("MAPI")

InitOutlook = True

Init_End:
Exit Function
Init_Error:
InitOutlook = False
Resume Init_End
End Function

Sub ContactGrab()
Dim fdContacts As Outlook.MAPIFolder
Dim fdItems As Outlook.Items
Dim fdItem As Object
Dim R As Integer

If olApp Is Nothing Then
If InitOutlook = False Then
MsgBox "Unable to initialize Outlook application or namespace"
Exit Sub
End If
End If

Set fdContacts = olNS.GetDefaultFolder(olFolderContacts)
Set fdItems = fdContacts.Items

Sheets("Sheet1").UsedRange.Clear

R = 1
With Sheets("Sheet1")
.Rows("1").Font.Bold = True
.Cells(1, 1).Value = "Contacts First Name"
.Cells(1, 2).Value = "Contacts Last Name"
.Cells(1, 3).Value = "Contacts Email Address"
.Columns("A").ColumnWidth = 32
.Columns("B").ColumnWidth = 36
.Columns("C").ColumnWidth = 26

End With

For Each fdItem In fdItems
On Error Resume Next
R = R + 1
With Sheets("Sheet1")
.Cells(R, 1).Value = fdItem.FirstName
.Cells(R, 2).Value = fdItem.LastName
.Cells(R, 3).Value = fdItem.Email1Address
End With
Next

End Sub


Steve



"FSTC892" wrote in message
...
I create sales quotes to customers in Excel. I want to be able to lookup
the
customer contact information that is already in Outlook while working in
Excel and automatically copy or enter that contact information into my
sales
quote in Excel. Is this possible?




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
Excel 2003 FAILS, but Excel 2000 SUCCEEDS ??? Richard Excel Discussion (Misc queries) 2 May 13th 23 12:46 PM
How do I create a list in excel that contains external data? bill@bb Excel Discussion (Misc queries) 1 February 15th 05 03:45 AM
How to sort/update large excel db [email protected] Excel Discussion (Misc queries) 0 February 2nd 05 01:43 AM
Can I create a static link between Excel and Outlook contact data. Bokeltri Excel Discussion (Misc queries) 3 January 31st 05 02:57 PM
Help with data not getting plotted Scott Ehrlich Excel Discussion (Misc queries) 2 January 25th 05 06:17 AM


All times are GMT +1. The time now is 04:44 AM.

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"