This is returning the X400 name for your exchange server. I am not sure this is possible through the basic Outlook Object Model, you could use LDAP and query the Exchange server settings to get the SMTP based address. This newsgroup is more for VSTO Related queries.
Sample VBScript file
' Create the ADSystem Information Object
Set objADSystemInfo = CreateObject("ADSystemInfo") ' Get the current information into a new Object Set objUser = GetObject("LDAP://" & objADSystemInfo.UserName)
'Now use the mail property for the SMTP Address Wscript.Echo "SMTP Address: " & objUser.mail
Additionally you could use CDO but this isnt supported using Managed code :(
Regards
Mike Walker MVP - Visual Developer VSTO - Please mark the best replies as Answers ! |