Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Outlook Address Book Access Through VBA


Is there a method available to VBA using the Outlook Object library to open the users default address list and get an address clicked on in the address list to use in Access.

Coded example would be appreciated if anyone has a working example.

Thanks




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Access Address Book In Outlook '02
Description of application: Vba in Outlook '02, opens attachment (efax), displays a listbox filled with all users within the dept., and finally forwards email to selected user. For example: Based on the information on the fax attachment, the user will select from a list (on a form/listbox) then vba automatically forwards it to the person selected on the listbox. Oh and by the way, this is needed because each employee is assigned to a specific city. The listbox displays the cities and who is assigned to them.
What I need: A way for someone to add names to the contact list. This list (listbox) comes from an excel spreadsheet located on a network drive.
Solution1: I could have the user enter the names on an inputbox, etc. However that leaves room for error and a possible mismatch between how the name is entered and how it shows in the address book. Once the email is forwarded, I want to make sure that it won't have problems finding the name in the To: field.
Solution2: I could use the below code at the bottom, to fill an array and display that array on a listbox. I think that would be duplicating what exactly the address book does.
Solution3: I would rather have it open the viewer for the address book like the attached where the user can select the name to add. Once the user selects it, how do I get pull that information so it can be transferred to the excel spreadhsheet?

Let me know if this isn't clear.
Thanks in advance.
Aaron


Code:
Dim oAdrLst As Outlook.AddressList
Dim oAdrEnt As Outlook.AddressEntries
Dim objApp As New Outlook.Application

'Return the personal address book.
Set oAdrLst = objApp.GetNamespace("MAPI").AddressLists(1)
Set oAdrEnt = oAdrLst.AddressEntries

Dim i As Integer
Dim strAddress() As String

ReDim strAddress(oAdrEnt.Count - 1) As String

For i = 1 To oAdrEnt.Count
strAddress(i - 1) = oAdrEnt.Item(i).Name
Next

How To Access Outlook Express 5.0 Address Book?
hi,

i am doing an application called PAB(Personal Address Book)

i want to import the address book of the outlook express in an list view.

in my system i had both outlook express and outlook 2000.

iam able to read the outlook 2000,but iam unable to read the outlookexpress 5.0..

is there any solution to this problem?
couls any body suggest the solution

regards
varma_varma@rediffmail.com

How To Access Address Book In Outlook Express ?
how to access Address book in outlook express ?
from vb code offcourse.

Accessing My Outlook Address Book From An Access Form
Hi all,

Within an Access form, I want to create a button that when pressed accesses my Outlook address book. Can anybody help??

I am new to VBA and Access.

Thanks,

Felipe.

Is There A Way Stop The Prompt Outlook Displays When Trying To Access Address Book
is there a way to stop the prompt outlook displays when trying to access address book

Some programs can access the outlook address book and some need the user to click Allow Access for 10 Minutes

*Resolved* Use MAPI To Retrieve SMTP Address From Outlook Address Book
I want to load a user table with the names and e-mail addresses from our Outlook address book so that remote users who are not connected to our intranet can use the addresses.

I am using MAPI to retrieve information from the outlook address book using the MS Exchange settings. When I try to retrieve the objAddressEntry.Address, I do not get the SMTP address which is what I want to retrieve. The address that is retrieved using the objaddressentry looks like this "/o=value/ou=COMPANY/cn=Recipients/cn=entry name".

We exported the address book to a .csv file and imported it into excel. This spreadsheet had two columns of data related to the e-mail address... the first is named "E-mail Address"... the second is named "E-mail Addresses". The first column only contains information for entries that have addresses outside the company. these are the actual e-mail addresses that we want to load into our table and are equal to the value of the SMTP address in the second column

The second column consists of multiple e-mail addresses (SMTP,MS,X400, and CCMAIL):

example1 - entry with address inside company:
SMTP:MBaker@companyname.com%MSOMAIN/COMPANY/MBAKER%X400:c=US;a= ;p=DOMAIN;o=COMPANY;s=Baker;g=Marilyn;%CCMAIL:Baker, Marilyn at COMPANY

example2 - entry with address outside company:
SMTP:name@provider.com.br%X400:c=US;a= ;p=DOMAIN;o=COMPANY;s=Barbosa;g=Anderson;%CCMAIL:Barbosa, Anderson at COMPANY%MSOMAIN/COMPANY/ABARBOSA

What we need to store in our user table is the SMTP value in this second field... but that is not what is retrieved in the .address property of the addressentry object.

Is there a way to retrieve this info using VB?


Thanks





Edited by - Tenslvr3 on 7/28/2005 8:04:09 AM

Do Email Address Lookup From Outlook Address Book.
Hi everyone,
I am using VB 6. Can I do a lookup and select an email address from Outlook address book using VB?

Below are my codes:


Code:

SENDEMAIL:
Set OutlookApp = CreateObject("Outlook.Application")
Set OutlookMail = OutlookApp.CreateItem(0)

OutlookMail.To = "giftxtian@yahoo.com" <-- hard-coded address.
OutlookMail.Subject = "Project Status"
OutlookMail.Body = "This is VB email test"

If Len(MailAttach) = 0 Then
OutlookMail.Attachments.Add MailAttach '"C:ProjectStatus.xls"
End If

OutlookMail.Display 'To display the email
OutlookMail.Send 'To send the email

Thanks.

GiftX

VB6 - Look Up Email Address From Outlook Address Book?
Hello everyone,
is there a posibility that I can look up email addresses from outlook email address book instead of accepting email address from an inputbox or hard-coding it?
See my codes below:
Thanks.


Code:

SENDEMAIL:
Set OutlookApp = CreateObject("Outlook.Application")
Set OutlookMail = OutlookApp.CreateItem(0)

OutlookMail.To = EmailID
OutlookMail.Subject = "Project Status"
OutlookMail.Body = "This is VB email test"

If Len(MailAttach) = 0 Then
OutlookMail.Attachments.Add MailAttach '"C:ProjectStatus.xls"
End If
tgifgemini

Fetch Address From Address Book-outlook
outlook
hi all
i have developed an application to send an email from VB, i dont know how to fetch all emails from address book and to send, @ present now the email and text is been displayed at the screen when we use to type the address or click it from address book then it send the mail,pls help
cheers
parthi

Outlook Address Book
Hi All,

How can we get the addresses from Outlook address book into a listbox?

Hope i' clear.

Thanks,

Outlook Address Book
Dear All,

Is it possible to access and read the contacts in Outlook address book (All folders) through VB ?
I have tried to use outlook objects, but cud not find the proper way to access the address book

Outlook Address Book
Hello,

Doeas anybody knows how to make a programm where I can see
the outlook address book entrys. The programm I'm working at will send emails with an attachement, it's not the purpose to
use outlook. Just the address book from outlook.

Johan

Outlook Address Book
How can I show addressbook dialog of Outlook 2000?

Outlook 97 Address Book
I want to create a load of new enties in an Outlook 97 Address Book.
The contact names and fax numbers are stored in an Access database.
How can I automate the creation of address book entries?

MS Outlook&#039;s Address Book
I know that the Address Book can be accessed from any app in Windows and that it doens't "belong to Outlook only, So I've been wondering if there is any way I can open the address book from my app and when I double-click a name, it pops the E-Mail address of that person into a textbox in my app.

Thanks
,Asaf Sagi

Getting A Name From The Outlook Address Book
I want to open the Global Address Book and look up a name that the user types into a login screen. It's not a security issue, just an ID needed. I can get to the Address Book Object, but I can't get the list of names.

How do I get to the names?

Thanks,



Scott
The worst thing about wearing glasses is them being on your face.
Nothing is impossible, it just looks that way.

Outlook Address Book
Hi,
How can I access the Outlook 97 address book to search for a given name (OLE, dll ...) ?

I'm trying to sent a mail using Outlook which works fine however, when the recipients name is not unique the address book screen comes up and I can not figure out how access this screen from my VB application.

Any help would be highly appreciated ... tiescher

OUTLOOK Address Book
Anyone know of an easy way to pull up the address book in VBSCRIPT. As always any help is greatly appreciated.

Outlook Address Book
How can we access the MS Outlook address book from Visual Basic. Can we also send automated e-mails to those contacts from within VB ?

Please help. Does this involve API calls ?

MAPI And Outlook Address Book
I found that if I use the .show even in the MAPIMessages object it will open outlooks address box and let the user select addresses.

after they select the addresses how do I put the addresses they selected as the RECIPAddress?

,Thanks
Rick

Opening Outlook Address Book!!!
Hello everyone.

I succeeded opening outlook's address book in this way:

Set objSession = CreateObject("MAPI.Session")
objSession.Logon , , False, False
Set colCDORecips = objSession.AddressBook(Title:="Select new users names", toLabel:="New employees", parentWindow:=0)


however, when outlook is closed this way fails.
is it possible to open outlook's address book FORM when outlook is closed, if not how can i load outlook so that it will be open before i open the address book form.

many thanks for your help, tal.

Problem With Address Book In Outlook.
Here is my code for opening the Address Book in Outlook:


Code:
Private Sub cmdAddressBook_Click()

Dim Receip As String
Dim i As Integer

On Error GoTo ToAddError

MAPISession1.SignOn
MAPIMessages1.SessionID = MAPISession1.SessionID
MAPIMessages1.MsgIndex = -1
MAPIMessages1.AddressEditFieldCount = 1
MAPIMessages1.Action = MESSAGE_SHOWADBOOK
MAPISession1.SignOff

For i = 0 To MAPIMessages1.RecipCount - 1
MAPIMessages1.RecipIndex = i
Receip = Receip & MAPIMessages1.RecipDisplayName
Receip = Receip & "/nml@mercury,"
Next i

Exit_Early_Add:
Exit Sub

ToAddError:
If Err <> 32001 And Err <> 32003 Then
MsgBox "Mail Error: " & Chr$(13) & Err & Error$(Err), , "Mail Error"
DoEvents
End If
Resume Exit_Early_Add

End Sub


The problem I'm having is when the Address Book is opened for the second time, the last name selected still appears in the
MAPIMessages1.RecipDisplayName field. I would like this field to be cleared out.

I tried using: MAPIMessages1.RecipDisplayName = " ", but I get an "_" (underscore character) in the MAPIMessages1.RecipDisplayName field.

Any Ideas??

Edit by mkoslof: Added VB tags for easier reading. Thanks

Outlook Address Book To Listview
I want to retrieve the names of all the contact to a listview. Can anyone show me how??

Sharing Address Book In Outlook
I have an office with 5 computers that are networked. Is there any way for them to share a common address book/contacts folder in Outlook 2000?

Outlook Address Book Into Excel
Is there anyway of outputting the outlook address book into excel in a way that it becomes like a database......

Thanks

Outlook Address Book Path
hello. how to find full path to the address book (*.wab) for outlook express or outlook 2002

saxn!

Outlook Express Address Book
Is there a way to create an outlook express address book??? If yes, how??? Pleeeeaaaaaaaseeeee help.... thanks a million.....

How To Print Outlook Address Book
I need to be able to print the outlook address book.
Does anyone know some simple code to do this?

Thanks.....

Call Outlook Address Book
Is there a way to to callup the outlook address book to se the name list

Outlook Express Address Book
I have an application written in Vb6 where I have been asked to add e-mail option to. The part of e-mail was fine but now they want me add an option where they like to see the all the names from address book.

What I want to do is read all the names and e-mail address from the address book and save it to a list box. How can I do this?

Thanks
Sunil Prasad

Outlook 97 Global Address Book
I have an application that currently relies on the users typing in the correct Exchange alias ID in order for an automated message to be sent out. There have been a few cases were the incorrect alias was entered and therefore an error throws up.

Is there a way I can pop up the Global Address book and set a var based on who was selected for use in my email send routine?

Existing code as follows:

' Email user
Dim olApp As New Outlook.Application
Dim nspNameSpace As Outlook.NameSpace
Dim olMail As Outlook.MailItem

Set nspNameSpace = olApp.GetNamespace("MAPI")
Set olMail = olApp.CreateItem(olMailItem)

With olMail
    .To = strRecipient
    .ReplyRecipients.Add ("ukcscus")
    .Subject = "Call ref: " & strProductTPM & " " & strSMSName
    .Body = strEmailBody
    .Send
End With

Set olApp = Nothing
Set nspNameSpace = Nothing
Set olMail = Nothing

Any help would be fab.

Cheers,
Paul

Retrieve Outlook Address Book Using VB6
hi all,

How to retrieve outlook address book using VB6 and store that data in ms access ?
Plz suggest me how to solve this problem, if possible post a your code

thanks&Regards
shajahan(virgosys)




Edited by - shajahan on 10/20/2003 3:11:26 AM

Import Outlook Address Book
hello

how can i import the address book in a list using vb irrespective of me having outlook or outlook express

short and sweet question


Samir
Skill is successfully walking a tightrope over Niagara Falls. Intelligence is not trying.

Edited by - samirprabhudesai on 11/17/2003 3:53:28 AM

Vb Read Outlook Express Address Book
hay all,

pls help me.

I want to read the address book of outlook express by visual basic program.

Can anybody help me in this regard.

Its urgent.

Regards,
Andy

Exporting Address Book Data From Outlook
Hey Everyone:

I know that Address books in Outlook are stored as .pab's, I'm wondering if they can be converted to a .txt file so's to import them into Excel.

If so, is this something I need to do Manually, or can we get old VBA to talk to Outlook (preferably from XL) to convert and import them into Excel...

Any ideas would rock!

Thanks in advance...

--Dodd

How Do You Use A SQL Select Statement On An Outlook Address Book
How can you select all the first and last names (info) from an Outlook address book?

ADO code...

OUTLOOK: Search Address Book For Attendees..
I'm customizing the Appointment form in MS Outlook with VBScript and I wish to seach through the address book for an attendee.

Specifically, They have created a new Group (I don't know if that's the correct term) on the Exchange server and each of their conference rooms have been added as a user and added to that Conference Room group. I want to search through all of the Attendees of an Appointment and see if any of them belong to that Conference Room group.

Ya get it? If anyone has any expertise in this matter I'd appreciate the help. MSDN's documentation of the Outlook object model is nonexistant..

Thanks!

--Ben

Outlook Address Book Emaol Id Doubt????
hi all
following is the code to fetch address from the address book , its working fine if i run the project, but i cant able to fetch the email id alone, can any one please help me to get email id alone instead of name.
replies will be helpful
cheers
parthi

***********code to fetch address and name from outlook address book
Option Explicit
Dim olApp As Outlook.Application
Dim olNS As Outlook.NameSpace
Dim olAL As Outlook.AddressList
Dim olAE As Outlook.AddressEntry
Dim olMail As Outlook.MailItem
Private Sub Form_Load()
Set olApp = New Outlook.Application
Set olNS = olApp.GetNamespace("MAPI")
For Each olAL In olNS.AddressLists
For Each olAE In olAL.AddressEntries
lvw.ListItems.Add , , olAE.Name
lvw.ListItems(lvw.ListItems.Count).SubItems(1) = olAE.Address
lvw.ListItems(lvw.ListItems.Count).SubItems(2) = olAE.ID
lvw.ListItems(lvw.ListItems.Count).Tag = olAE.ID
Next
Next
End Sub

Retrieving ALL Emails From Outlook Address Book
Hi,
I'm making an email client, and an important feature i'm trying to implement is the ability to import all email addresses from the MS Outlook address book.

I am really hoping there is someone out there that is really intelligent, and knows alot about algorythems etc, as I'm sure it's encrypted in a file somewhere from security reasons.

The reason I needed it done this way, is becuase I didn't want to use an OCX control.

So just recapping, I need to retrieve ALL emails from the MS Outlook address book, not using an Active-X control, however some other method like API, or actually decrypting information from the registry, or a file.

Thankyou for reading,
Sphynx

VBA Word VB Form Add Outlook Address Book
Hi People. I would like to either add a Outlook address button or reference the Outlook address button control on my VB Form in MS Word. Also I was wondering if anyone know how to set the To, Cc, subject, etc. (with code) in the Word fields when some click on File -> Send To -> Mail Recipient.

Thank you,

DAVE

VB6 Multiple Column List, Like Outlook Or Address Book
Hi all.

I am making an address book module for an application and I would like to use a listview similar to those at Outlook or any other application (consider Kazaa or eMule for instance, where all downloading items are in a list, with multiple columns).

I came across with VB Accelerator's S-Grid and I think that it would fit my needs, but the ocx gives an error (Runtime error '0') at initialization.

It seems that I can't find a control to do such a simple job!

If anyone knows about a control to fit my needs, please let me know.

Thanks in advance,
Fábio Silva

How To Get Data From Outlook 97 Address Book In Visual Basic
how to get data from outlook 97 address book in visual basic

Integration With Outlook Express Type Address Book
Hi All,

We are looking into adding a new feature to our software, and I'm wondering if any of you know about this, or have done it before. We want to be able to add entries from our database to an Outlook type address book. Whether we add entries to the existing address book or create a new one that can be imported doesn't matter, we just want a way of getting our information from our database into Outlook some way or another.

Are there any special controls or active x components that would enable us to do this easily?

Any ideas?



Edited by - JoshSommers on 8/8/2002 11:24:10 AM

Adding Contacts From Outlook Address Book To List
I have a list on my form. How do I add contacts from a outlook address book to that list? I have searched high-and-low on this forum and a other websites and have not really found anything. I did find this however here on VBCity:
Code:
Dim myOlApp As New Outlook.Application
Dim myNameSpace As Outlook.NameSpace
Dim myFolder As Outlook.MAPIFolder

Set myNameSpace = myOlApp.GetNamespace("MAPI")
Set myFolder = myNameSpace.GetDefaultFolder(olFolderContacts)

For x = 1 To myFolder.Items.Count
    Debug.Print myFolder.Items(x).FirstName
    Debug.Print myFolder.Items(x).LastName
    Debug.Print myFolder.Items(x).HomeTelephoneNumber
Next x


I tried modifying the code by putting "Debug.Print myFolder.Items(x).Address", but this did not work. Nor did many other possible variations for "email address". O, and of course I added the reference to Microsoft Outlook. Any help????

Outlook Address Book Provider In Visual Basic
Ok,

Hi all, been a little while since i've been on here, but i need some help and theres no better place for it

Anyway, im trying to develop an Address Book Provider for Microsoft Outlook XP/2003 ... I have sample code in C++ but I was wondering if anyone knew how to (if at all possible) achieve the same thing in Visual Basic 6 (or .net ? ) .

Any information would be greatly appreciated.

Thanks in advance.

Reading Email Id From Address Book Of Outlook Express
Hi...
Can Any 1 tell me how to Read Email Id's from Address book of Outlook Express using Vb code. i have written a code which works as outlook express but i am not able to use the existing contacts in the outlook express' address book .I need to use those contacts without exporting it to any file format




rOniL

VBA Outlook, Sender's Email, And Global Address Book
Two things... Outlook 2000
1. i want access the sender email address rather then the senders name(msg.SenderName) So how do i do this, had trouble finding the property that does this???

2. How can i then access the Global address book to cycle through the name of people in the address book??

thanks
vin

Send A Email (with Optional Attachment) To Everybody In Outlook Address Book
Hi im trying to program an app for my office to simpilize sending emails to everybody in our address book (with optional attachment) to everybody in outlook address book.
Ive looked around for source code but cant find any thing that works.

(Note: I know you can do it in Outlook but not everybody in our office is bight )

Any source code or links would be great.

Thanks

Address Book Outlook Express Folder Path Detection
Dear Gurus!

How to find out an exact path to the outlook espress address book directory

for instance 9x has path %windir%appliction datamicrosoftaddress book
and xp has c:documenets and settings\%username%Application DataMicrosoftAddress Book

and nt has something like profiles\%username% etc

so, is there any API function or something like GetTempDir, that leads to %user% folder?

sorry if i did not make myself clear



or maybe even outlook EXPRESS itself can say the right path to the directory if i do reference to him?

Copyright © 2005-08 www.BigResource.com, All rights reserved