Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Usage of Outlook data via VBA in Excel

Hi,

I find no matching link for my small problem. I'm using Windows XP
and
Office 2003 with an Exchange server in the background. The user name
to log into Windows is the same name as for Outlook/Exchange.


In an Excel application I have a formular with some data. One of the
data shall be the first name, the last name and the phone numer of
the
user who just opened my Excel application. For comfort reasons I want
to fill these fields automatically by default. The mentioned data are
available via Outlook. When I enter in Outlook a name in field "To:"
and do a douuble-click on the name I get the required information.


I'm very sure that there has to be a small solution that can be used
within Excel/VBA that does the following:
- get the current Windows Loginname (could be done via VBA command
environ("USERNAME"))
- with this piece of information find the first name, last name
phone
numer of this user (from the outlook address book) and store this
information in three variables.


In our firm we use Outlook 2000 as well as Outlook 2003. The best
would be not to set any references in VBA via "Tools | reference" so
that this solution runs with both Outlook versions.


I hope that someone can help me.


Thanks in advance
Winfried

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Usage of Outlook data via VBA in Excel

Winfried,
Not sure how you get from the Windows UserName to the personal details in an
Address Book; maybe use this in Windows:
http://vbnet.mvps.org/code/network/netusergetinfo.htm

After that, using Automation on Outlook to get the PhoneNumber.
Sounds like you want to use Late Binding also.
http://www.google.co.uk/search?hl=en...e+Search&meta=

NickHK

"Winfried" wrote in message
oups.com...
Hi,

I find no matching link for my small problem. I'm using Windows XP
and
Office 2003 with an Exchange server in the background. The user name
to log into Windows is the same name as for Outlook/Exchange.


In an Excel application I have a formular with some data. One of the
data shall be the first name, the last name and the phone numer of
the
user who just opened my Excel application. For comfort reasons I want
to fill these fields automatically by default. The mentioned data are
available via Outlook. When I enter in Outlook a name in field "To:"
and do a douuble-click on the name I get the required information.


I'm very sure that there has to be a small solution that can be used
within Excel/VBA that does the following:
- get the current Windows Loginname (could be done via VBA command
environ("USERNAME"))
- with this piece of information find the first name, last name
phone
numer of this user (from the outlook address book) and store this
information in three variables.


In our firm we use Outlook 2000 as well as Outlook 2003. The best
would be not to set any references in VBA via "Tools | reference" so
that this solution runs with both Outlook versions.


I hope that someone can help me.


Thanks in advance
Winfried



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Usage of Outlook data via VBA in Excel

Hi Nick,

Inside VBA the VBA command "environ" -environ ("USERNAME")- really
works fine and gives me the Windows login name. Do have "THE" link
what helps me to get the required Outlook information for VBA inside
Excel? That would be great!!!

Winfried

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Usage of Outlook data via VBA in Excel

Winfried,
Check the VBA Help in Outlook for "Find Method".
So I assume your contacts have a field of "Username", so you can find their
real name and phone number ?

NickHK

"Winfried" wrote in message
oups.com...
Hi Nick,

Inside VBA the VBA command "environ" -environ ("USERNAME")- really
works fine and gives me the Windows login name. Do have "THE" link
what helps me to get the required Outlook information for VBA inside
Excel? That would be great!!!

Winfried



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Usage of Data Validation with If Condition Mujeeb ur Rehman, FBL-GRW-PK Excel Worksheet Functions 4 January 28th 10 04:32 PM
data validation & key board usage yshridhar Excel Discussion (Misc queries) 7 August 29th 08 03:16 AM
Extracting data from Outlook to Excel using VBA HBruno Excel Worksheet Functions 0 July 23rd 08 03:32 PM
How can i get formatted data from outlook to excel? [email protected] Excel Worksheet Functions 2 January 11th 07 06:11 AM
converting data in Excel to Outlook LAB in South Excel Discussion (Misc queries) 0 January 30th 06 08:36 PM


All times are GMT +1. The time now is 12:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"