View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
tmountjr tmountjr is offline
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/