Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default excel vba interface with outlook (office 2000)

I'm writing (or trying to write) some code in Excel VBA to extract the
current logged-in user's email address from Outlook. I figured out how
to go through the namespace and access the currentuser:

Sub test()

Dim a As Recipient
Set a = Outlook.Application.GetNamespace("MAPI").currentUs er

MsgBox a.AddressEntry.Address

End Sub

This returned a cryptic string that I can parse and bring to a usable
email address, but the problem is that it comes up with message saying
that it needs special permission to access the information. The error
box that comes up is: "A program is trying to access e-mail addresses
you have stored in Outlook. Do you want to allow this?" I could't find
anything in the security informatino to stop that from coming up. I
need this to be seamless so it can fit in an automated process. Is this
the best way to retrieve an email address from a login, and if so, how
do I stop that message from coming up?


---
Message posted from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default excel vba interface with outlook (office 2000)

Hi,

I don't think you can get this through Outlook (version newer than 2000 sp2)
without running into this security warning. You may want to look into a
product called "Outlook Redemption", which may allow you to get around the
security warning.

Another option is to look in the registry for the user's email address. One
place I found my email addresses is subkeys of this registry key:

HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\UnreadMail\

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]


I'm writing (or trying to write) some code in Excel VBA to extract the
current logged-in user's email address from Outlook. I figured out how
to go through the namespace and access the currentuser:

Sub test()

Dim a As Recipient
Set a = Outlook.Application.GetNamespace("MAPI").currentUs er

MsgBox a.AddressEntry.Address

End Sub

This returned a cryptic string that I can parse and bring to a usable
email address, but the problem is that it comes up with message saying
that it needs special permission to access the information. The error
box that comes up is: "A program is trying to access e-mail addresses
you have stored in Outlook. Do you want to allow this?" I could't find
anything in the security informatino to stop that from coming up. I
need this to be seamless so it can fit in an automated process. Is
this the best way to retrieve an email address from a login, and if
so, how do I stop that message from coming up?


---
Message posted from http://www.ExcelForum.com/


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
Need dynamic name range in Excel for Outlook interface John E. Excel Worksheet Functions 3 September 17th 06 07:21 AM
Office 2000/Office 2003 Excel not printing landscape vise versa BAHTTEXT in English text Setting up and Configuration of Excel 1 April 17th 06 01:37 PM
I cannot edit cell format in Excel 2000 (Part of office 2000)! Brett Excel Discussion (Misc queries) 1 April 12th 06 05:58 PM
need help with Outlook/Excel interface Brainless_in_Boston New Users to Excel 3 February 24th 06 07:36 PM
Excel Programs developed in Office 2000 on Windows 2000 Trooper Excel Discussion (Misc queries) 4 March 12th 05 11:09 PM


All times are GMT +1. The time now is 04:55 PM.

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

About Us

"It's about Microsoft Excel"