A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook - General Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

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



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old July 11th 07, 04:03 PM posted to microsoft.public.outlook
Alex
external usenet poster
 
Posts: 2
Default Get the Name and Phone Number of the Current Windows User from Outlook 2003

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

Hello All,

I have asked the question yesterday he

http://groups.google.com/group/micro...abc34416f227e4

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.

In Visual Studio 2005, after "Adding Reference"-- COM -- Microsoft
Outlook Object Libary 11.0

I can do something like:
2. After add Outlook Object references, I can do something like:


Outlook._Application olApp = new Outlook.ApplicationClass();
Outlook.NameSpace oNS = olApp.GetNamespace("MAPI");
Outlook.AddressList oAL = oNS.AddressLists["Global Address List"];
Outlook.AddressEntries oAEs = oAL.AddressEntries;

In this way, I can get the AddressEntries. But nowhere can I find
business phone number. Again, I am using Outlook 2003

Your input is highly appreciated.

Thanks.

Alex

Ads
  #2  
Old July 11th 07, 04:22 PM posted to microsoft.public.outlook
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Get the Name and Phone Number of the Current Windows User from Outlook 2003

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.a...essageid=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/comm....program_v ba


--
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" wrote in message oups.com...
Get the Name and Phone Number of the Current Windows User from Outlook
2003

Hello All,

I have asked the question yesterday he

http://groups.google.com/group/micro...abc34416f227e4

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.

In Visual Studio 2005, after "Adding Reference"-- COM -- Microsoft
Outlook Object Libary 11.0

I can do something like:
2. After add Outlook Object references, I can do something like:


Outlook._Application olApp = new Outlook.ApplicationClass();
Outlook.NameSpace oNS = olApp.GetNamespace("MAPI");
Outlook.AddressList oAL = oNS.AddressLists["Global Address List"];
Outlook.AddressEntries oAEs = oAL.AddressEntries;

In this way, I can get the AddressEntries. But nowhere can I find
business phone number. Again, I am using Outlook 2003

Your input is highly appreciated.

Thanks.

Alex

  #3  
Old July 11th 07, 05:17 PM posted to microsoft.public.outlook
Alex
external usenet poster
 
Posts: 2
Default Get the Name and Phone Number of the Current Windows User from Outlook 2003

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]"
wrote:
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 athttp://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 athttp://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, athttp://www.microsoft.com/office/community/en-us/default.mspx?dg=micro...

--
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" wrote in ooglegroups.com...
Get the Name and Phone Number of the Current Windows User from Outlook
2003


Hello All,


I have asked the question yesterday he


http://groups.google.com/group/micro...languages.csha...


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.


In Visual Studio 2005, after "Adding Reference"-- COM -- Microsoft
Outlook Object Libary 11.0


I can do something like:
2. After add Outlook Object references, I can do something like:


Outlook._Application olApp = new Outlook.ApplicationClass();
Outlook.NameSpace oNS = olApp.GetNamespace("MAPI");
Outlook.AddressList oAL = oNS.AddressLists["Global Address List"];
Outlook.AddressEntries oAEs = oAL.AddressEntries;


In this way, I can get the AddressEntries. But nowhere can I find
business phone number. Again, I am using Outlook 2003


Your input is highly appreciated.


Thanks.


Alex- Hide quoted text -


- Show quoted text -



 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to add phone numbers to current contacts in Outlook 2003 vaders.bane Outlook - Using Contacts 0 July 7th 07 11:06 PM
Outlook 2003 Phone Number format. Mark Gibbons Outlook - Using Contacts 2 March 31st 07 10:48 PM
Why can't I search by phone number in Outlook 2003 contacts no DCDuring Outlook - Using Contacts 4 September 7th 06 01:17 AM
Why can't I search by phone number in Outlook 2003 contacts no Ngwane Outlook - Using Contacts 0 April 5th 06 02:00 PM
Outlook 2003- contact phone number format Om Audio Outlook - General Queries 0 February 21st 06 08:40 PM


All times are GMT +1. The time now is 07:08 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.