K
Kristy
I am using an Exchange Server, Office XP, and have written a Com
add-in (VB6) and I need to get the default email address of the
current user.
I have been using this, which works OK but the
'objSession.CurrentUser' invokes security prompts ...
Set golApp = CreateObject("Outlook.Application")
Set objSession = golApp.CreateObject("MAPI.Session")
objSession.Logon "", "", False, False
Set objAddressEntry = objSession.CurrentUser
Set objFields = objAddressEntry.Fields
Set objMailAddresses = objFields.item(PR_EMS_AB_PROXY_ADDRESSES)
If Not objMailAddresses Is Nothing Then
strAddresses = objMailAddresses.Value
For IntCounter = LBound(strAddresses) To UBound(strAddresses)
strSMTP = strAddresses(IntCounter)
etc....
I would like to bypass the security prompts and have purchased Outlook
Redemption to help me with this, however I can't get it to work...
Set golApp = CreateObject("Outlook.Application")
Set objNameSpace = golApp.GetNamespace("MAPI")
Set objAddressEntry = CreateObject("Redemption.SafeCurrentUser")
Set objFields = objAddressEntry.Fields 'error occurring here
Set objMailAddresses = objFields.item(PR_EMS_AB_PROXY_ADDRESSES)
If Not objMailAddresses Is Nothing Then
strAddresses = objMailAddresses.Value
For IntCounter = LBound(strAddresses) To UBound(strAddresses)
strSMTP = strAddresses(IntCounter)
....
I am getting an error "wrong number of arguments or invalid property
assignment" on the following line
Set objFields = objAddressEntry.Fields
Am I going about this completely the wrong way? I have tried all sorts
of different methods from posts I have found but am not getting
anywhere, I am a newbie and my brain is about to explode, does anyone
have a code example of how to achieve this?
Please help me!
add-in (VB6) and I need to get the default email address of the
current user.
I have been using this, which works OK but the
'objSession.CurrentUser' invokes security prompts ...
Set golApp = CreateObject("Outlook.Application")
Set objSession = golApp.CreateObject("MAPI.Session")
objSession.Logon "", "", False, False
Set objAddressEntry = objSession.CurrentUser
Set objFields = objAddressEntry.Fields
Set objMailAddresses = objFields.item(PR_EMS_AB_PROXY_ADDRESSES)
If Not objMailAddresses Is Nothing Then
strAddresses = objMailAddresses.Value
For IntCounter = LBound(strAddresses) To UBound(strAddresses)
strSMTP = strAddresses(IntCounter)
etc....
I would like to bypass the security prompts and have purchased Outlook
Redemption to help me with this, however I can't get it to work...
Set golApp = CreateObject("Outlook.Application")
Set objNameSpace = golApp.GetNamespace("MAPI")
Set objAddressEntry = CreateObject("Redemption.SafeCurrentUser")
Set objFields = objAddressEntry.Fields 'error occurring here
Set objMailAddresses = objFields.item(PR_EMS_AB_PROXY_ADDRESSES)
If Not objMailAddresses Is Nothing Then
strAddresses = objMailAddresses.Value
For IntCounter = LBound(strAddresses) To UBound(strAddresses)
strSMTP = strAddresses(IntCounter)
....
I am getting an error "wrong number of arguments or invalid property
assignment" on the following line
Set objFields = objAddressEntry.Fields
Am I going about this completely the wrong way? I have tried all sorts
of different methods from posts I have found but am not getting
anywhere, I am a newbie and my brain is about to explode, does anyone
have a code example of how to achieve this?
Please help me!