Solved

Address Book

Posted on 2001-07-18
14
282 Views
Last Modified: 2013-12-03
Hy.
 I want to know how i can read the Address Book (how i can get all the Contacts and
all the groups).
 And, has the Address Book the same structure under 98 and NT/2000.
 Because, under 98 all the Contacts are shown to all the user(all the
identities in the Outlook) and are the same for Outlook Express and Outlook
2000. Under Win 2000 there are some groups(?) for every user(identitie) in
Express and the Contacts in Express are not shown in Outlook 2000.
(is this done with the help of Groups)??
 
 Please help.
0
Comment
Question by:yhihi9
  • 5
  • 3
  • 2
  • +1
14 Comments
 

Accepted Solution

by:
_ov earned 150 total points
ID: 6293410
Here is the code I've used to do something like this. It can be buggy, unstable etc, but it shows the way to go.
btw, you need to edit the first lines of code for your system. And I've tested it only with Outlook 2000.

#pragma warning(disable:4146)
#import "c:\program files\Microsoft office\office\mso9.dll"
#import "c:\program files\common files\Microsoft shared\vba\vba6\vbe6ext.olb"
#import "c:\program files\Microsoft office\office\msoutl9.olb"
#pragma warning(default:4146)

#include <iostream>
#include <atlbase.h>

using namespace std;

void main(void) {
     ::CoInitialize(NULL);
     try {
          Outlook::_ApplicationPtr     app;
          Outlook::_NameSpacePtr          sess;
          Outlook::AddressListsPtr          als;
          Outlook::AddressListPtr          al;
          Outlook::AddressEntriesPtr     aes;
          Outlook::AddressEntryPtr     ae;
         
          app.GetActiveObject(L"Outlook.Application");
          if (app==NULL) app.CreateInstance(L"Outlook.Application");
          if (app==NULL) throw("Unable to find Outlook");
          sess = app->GetSession();
          als = sess->GetAddressLists();
          long x, m = als->GetCount();
          for(x=1; x<=m; x++) {
               _variant_t     v(x);
               al = als->Item(&v);
               aes = al->GetAddressEntries();
               long y, m2 = aes->GetCount();
               for(y=1; y<=m2; y++) {
                    _variant_t     v(y);
                    ae = aes->Item(&v);
                    _bstr_t nm = ae->GetName();
                    char *n = (char *)nm;
                    _bstr_t ad = ae->GetAddress();
                    char *a = (char *)ad;
                    cout << x << " " << y << " " << n << "(" << a << ")" << endl;
               }
          }
     } catch(const char *txt) {
          cout << txt << endl;
     }

     ::CoUninitialize();
}
0
 

Author Comment

by:yhihi9
ID: 6294937

 Thanks, but it's not quite what i'm looking for.
 That is Outlook 2000 Automation (i used it) but indeed it works only for O2000
not for Express(or let's say better i can'tmake it to work under Win2000
- i don't know how to extract all those Groups and the Contacts for every group)
 I am interested, maybe, in how to read the wab format and how to obtain the informations
i mentioned above.(and if there is any code i would like it in C++/VC++).

 Thanks.
0
 
LVL 32

Assisted Solution

by:jhance
jhance earned 150 total points
ID: 6295991
You want to use MAPI for this.  See:

http://codeguru.earthweb.com/internet/simple_mapi.shtml

for a example project that will help you get started.
0
 
LVL 1

Expert Comment

by:hide_in
ID: 6296691
I have wrote a prog to synchronize the address book of Outlook98/2000 and Outlook express.
I used MAPI to access the Outlook98/2000 address book, and
used the API of WAB32.dll to access the Outlook express address book.

I do it well.
if you think I can help, please tell me.
0
 

Author Comment

by:yhihi9
ID: 6303369

 Yes i am interested , but does it works under 98 and NT/2000?
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

Author Comment

by:yhihi9
ID: 6309767

 Hello.
 Can anyone tell me where i can find the format of the WAB  file?
0
 
LVL 32

Expert Comment

by:jhance
ID: 6309789
Reading the WAB file is not the way to do this.  To REPEAT my comment which you conveniently IGNORED!


You want to use MAPI for this.  See:

http://codeguru.earthweb.com/internet/simple_mapi.shtml

for a example project that will help you get started.
0
 
LVL 1

Expert Comment

by:hide_in
ID: 6332686
Of course, It's can work under win9x/win2000/winnnt
0
 

Author Comment

by:yhihi9
ID: 6370895
Sorry i have benn away for a few days.
 Hide in (if you still read this message) i will be very happy if you could give me the code.
 For  jhance . Thank you for your help (and i can say that you help me many times) i tryed your solution but it does not work as i want and need.
0
 
LVL 1

Expert Comment

by:hide_in
ID: 6371668
hi, yhihi9
I'm here.if you need I can write a demo to you and give you the code.
0
 

Author Comment

by:yhihi9
ID: 6376040

 OK i wait for the demo
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now