Get the Name and Phone Number of the Current Windows User from Outlook 2003
  Home FAQ Contact Sign in
microsoft.public.outlook only
 
Advanced search
POPULAR GROUPS

more...

microsoft.public.outlook Profile…
 Up
Get the Name and Phone Number of the Current Windows User from Outlook 2003         


Author: Alex
Date: Jul 11, 2007 08:03

Get the Name and Phone Number of the Current Windows User from Outlook
2003

Hello All,

I have asked the question yesterday here:

http://groups.google.com/group/microsoft.public.dotnet.languages.csharp/browse_t...

I got a lot of help there, but I may posted in the wrong place. I
also realized that I am using Outlook 2003. The new outlook object
model 2007 does not work. I may need to use API.

Here is an updated description.:

I am writing a simple .NET (C#) application. It needs to "automatic"
get the Name (last, first) and phone number of the current Windows
user.

The name and phone number can obviously be retrieved from the
Outlook.

I can safely assume:
(1) Outlook 2003 is installed.
(2) The phone number of the current Windows user is in the Outlook
profile.
Show full article (1.43Kb)
2 Comments
Re: Get the Name and Phone Number of the Current Windows User from Outlook 2003         


Author: Sue Mosher [MVP-Outlook]
Date: Jul 11, 2007 08:22

In versions before Outlook 2007, you would need to use a low-level API such as Extended MAPI, CDO 1.21, or Redemption. The VB/VBA sample at http://www.outlookcode.com/codedetail.aspx?id=594, for example, shows how to get a user's mobile number.

Or, use ADSI/LDAP to perform a lookup directly on the GAL (AD). For example, see Kevin's sample comment at http://www.outlookcode.com/threads.aspx?forumid=2&messageid=16305

FYI, there is a newsgroup specifically for general Outlook programming issues "down the hall" at microsoft.public.outlook.program_vba or, via web interface, at http://www.microsoft.com/office/community/en-us/default.mspx?dg=microsoft.public...

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54

"Alex" gmail.com> wrote in message news:1184166205.266673.296630@q75g2000hsh.googlegroups.com...
> Get the Name and Phone Number of the Current Windows User from Outlook
> 2003
>
> Hello All...
Show full article (2.49Kb)
no comments
Re: Get the Name and Phone Number of the Current Windows User from Outlook 2003         


Author: Alex
Date: Jul 11, 2007 09:17

Sue,

Thank you very much for your help. I continue to google on the
subject and found out that you are THE person of outlook
programming.

Ok, here are some limitations I have:
(1) I have to use C#
(2) I cannot use Redemption.

Here is what I got so far:
(after adding reference to Microsoft Outlook Object Library 11.0 and
CDO 1.21)

Outlook._Application olApp = new
Outlook.ApplicationClass();
Outlook._NameSpace olNS = olApp.GetNamespace("MAPI");

In olNS there is an MAPIOBJECT:
olNS.CurrentUser.AddressEntry.MAPIOBJECT

I would say business phone number must be in this MAPIOBJECT. Am I
right? If so, how can I get it?

Thank you very much

Alex

On Jul 11, 11:22 am, "Sue Mosher [MVP-Outlook]"
outlookcode.com> wrote:
> In versions before Outlook 2007, you would need to use a low-level API such as Extended MAPI, CDO 1.21, or Redemption....
Show full article (3.29Kb)
no comments