Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Need dynamic name range in Excel for Outlook interface | Excel Worksheet Functions | |||
Office 2000/Office 2003 Excel not printing landscape vise versa | Setting up and Configuration of Excel | |||
I cannot edit cell format in Excel 2000 (Part of office 2000)! | Excel Discussion (Misc queries) | |||
need help with Outlook/Excel interface | New Users to Excel | |||
Excel Programs developed in Office 2000 on Windows 2000 | Excel Discussion (Misc queries) |