Ah! Its not really the Address book, its the Global Address List. There
is no Alias field or property for a Contact, but let me whip up
something for this then.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
@%@$%, my vb crashed on the demo I had just finished for you
using CDO. When I get home tonight I will re-write it and post it.
It works great! Wish I had done a save.
I had it loading the entire GAL and showing all the Alias' and
email addresses. Even had a double click on the listview to bring
up the details of the Address Entry.
Oh well.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Well here it is in case you can use CDO. If you did a full install of
Outlook it should be installed already. If not you can install it from
the Outlook CD. Its Microsoft Collaboration Data Objects 1.21.
For client applications, you must install Outlook in order to install
CDO. In Outlook 2000 and later versions, CDO is included with
Outlook but is not part of the default setup, nor will it install on
first run. Therefore, you must explicitly select it during a custom
setup or use the Windows Installer object library to
programmatically install CDO
I cleared out some of the names and blocked the email address
from showing so they wont get spammed just in case, but it does
fillup the listview.
VB Code:
Option Explicit
'Add reference to MS CDO 1.21 Library
'Add reference to MS Office Outlook xx.x Object Library
'Add listview control (lvwGAL) 'Project > Components > MS Windows Common Controls 6.0
'Add 2 command buttons (cmdClose) and (cmdRefresh)
Private moApp As Outlook.Application
Private moNS As Outlook.NameSpace
Private moCDO As MAPI.Session
Private Const cdoPR_DISPLAY_NAME As Long = &H3001001E
Private Const cdoPR_ACCOUNT As Long = &H3A00001E
Private Const cdoPR_GIVEN_NAME As Long = &H3A06001E
Private Const cdoPR_SURNAME As Long = &H3A11001E
Private Const cdoPR_EMAIL As Long = &H39FE001E
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub cmdRefresh_Click()
GetAddressCDO
End Sub
Private Sub Form_Load()
On Error GoTo No_Bugs
'INITIALIZE OOM (JUST SO CDO CAN LOGON TO INSTANCE)
Actually I finished the re-write after the crash yesterday. It took
me about 30 minutes to do this. I just didn't have the time to
make it look nice and post because I was on overtime and I had
to go home.
Although the one issue is still the security popup, but I wrote
something this morning that I like to call "Outlook® Security
Prompt Dismisser™" or "DismissMe™" coming to a download site
near you soon. It took me about an hour to figure out that M$
placed a block on the message stream preventing the security
prompt from being automated in later versions of Outlook. But I
found a way around it in about another hour or so. Actually very
simple. M$ can't do anything about it either
VB/Outlook Guru!
Last edited by RobDog888; Sep 17th, 2004 at 02:38 PM.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Hi RobDog,
That sample code works perfectly. However, i'm trying to get the data from an exchange 2000 server with 51k entries which obviously takes quite a bit of time (over 10 mins). The good news is that our lists are broken down into different groups,and I need to get the address list for IRELAND-->Receipients.
I've tried variations on /vbcode "Set oAEntries = moCDO.AddressLists.Item("Flextronics.IRELAND.Recipients").AddressEntries" /endvbcode
but i get the error:
-2147221233 - [Collaboration Data Objects - [MAPI_E_NOT_FOUND(8004010F)]].
Although the one issue is still the security popup, but I wrote
something this morning that I like to call "Outlook® Security
Prompt Dismisser™" or "DismissMe™" coming to a download site
near you soon.
Great code, Rob. Did you ever post your dismisser? A search on DismissMe doesn't find anything, not even this post of yours.
The most difficult part of developing a program is understanding the problem.
The second most difficult part is deciding how you're going to solve the problem.
Actually writing the program (translating your solution into some computer language) is the easiest part.
Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read. Please Help Us To Save Ana
No I didnt because I needed to change it for protection of disassembly of the exe/dll and add a program registration scheme. Another project that I hopefully will be getting done real soon too. My delimma is if I should make it freeware or commercial and charge a very small fee for it? Would anyone pay $ for it when there is at least one other similar product for free?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
There are other ways to send email in VB6 without even using outlook - look into CDO.
The most difficult part of developing a program is understanding the problem.
The second most difficult part is deciding how you're going to solve the problem.
Actually writing the program (translating your solution into some computer language) is the easiest part.
Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read. Please Help Us To Save Ana
Hi Rob,
Stupid question time... Is there a form that you created to use the code you have provided?
Can you provide an example at all?
I have the exact same problem as the OP and this code should solve the problem for me... I hope.
Thanks!!