1

I am trying to dump the entire GAL from outlook through an Excel VBA Macro

I tweaked the code from below link to suite my needs in excel: Excel Dump GAL

I am able to extract most of the common fields, however I need help on following:

  1. In outlook when we right click on a contact & select "open outlook properties", we get below window: Contact's Outlook Properties In this window there is a "Notes" field which I want to extract for the user. Can someone suggest how to get that
  2. Any Birthday field of the user?

NOTE: I CANNOT install outlookspy due to corporate security policy.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Pal S
  • 51
  • 2
  • 12
  • So you are trying to extract the data from the AddressEntry object that you retrieve from the address list (GAL)? – Dmitry Streblechenko Oct 16 '17 at 17:45
  • Yes. However olMember.GetExchangeUser.Notes does not return anything. In some blogs they have suggested trying .Body. But that also does not return anything. Note: Since I already have the user's email address, if there is alternate way (not accessing AddressEntry object) of getting the "Notes". I am open to build that in the code too – Pal S Oct 16 '17 at 17:57
  • You really need to take a look at the data with OutlookSpy or MFCMAPI to make sure it is even there – Dmitry Streblechenko Oct 16 '17 at 18:03
  • If you refer to the screenshot that I posted in my initial question, you can see the contents are there in "Notes" fields like SAP Code, Seat Code, Level, Emp Type etc. Since, its my company laptop, can't install external tools like outlookspy. – Pal S Oct 16 '17 at 18:16

1 Answers1

1

The Notes edit box at that screenshot is bound to the PR_COMMENT_W property (DASL name http://schemas.microsoft.com/mapi/proptag/0x3004001F). It should be accessing through the AddressEntry.PropertyAccessor.GetProperty method. ExchangeUser.Notes should also work fine.

Dmitry Streblechenko
  • 62,942
  • 4
  • 53
  • 78
  • Awesome!! the .PropertyAccessor.GetProperty with the DASL did the trick. The ExchangeUser.Notes did not work though. Also can you suggest if there is a DASL to get the user's birthday? – Pal S Oct 16 '17 at 19:03
  • Do you see it in the address book in GAL? – Dmitry Streblechenko Oct 16 '17 at 19:34
  • No the birthday is not visible in the standard outlook contact fields, but looking at the link https://www.codeproject.com/Tips/127769/Insert-Outlook-Contact-Birthdays-in-Calendar i am wondering if the birthday field has a DASL name which can be dumped? GetExchangeUser.Birthday does not return anything. – Pal S Oct 17 '17 at 03:32
  • That is why you need to take a look at the GAL object with OutlookSpy or MFCMAPI to see if that property is available. – Dmitry Streblechenko Oct 17 '17 at 05:25