Accessing information for auto-popluation of custom fields using Redemption

D

David

Hi all,

I am currently looking at Redemption with an intent on buying it, to
allow me to program Outlook forms without the security prompts
continuously being displayed.

While it seems fairly straight-forward (and well documented) to create
an email item and send it programmatically, what I am wanting to do is
auto-populate various fields in my custom outlook form with values
that I look up through CDO, and through outlook objects. At the
moment the code that does this is causing several security prompts to
appear when I load the form.

Here is my startup code:

Function Item_Open()
If item.size = 0 Then 'if in compose mode
dim myOlApp

set myOlApp = CreateObject("Outlook.Application")
Item.UserProperties("Req Name") = _
myOlApp.Application.GetNamespace("MAPI").CurrentUser.Name

Const CdoPR_BUSINESS_TELEPHONE_NUMBER = &H3A08001E
dim objSession
set objSession = CreateObject("MAPI.Session")
objSession.Logon ,,,False
For each objAddrList in objSession.AddressLists
If left(objAddrList.Name,19) = "Global Address List" _
or objAddrList.Name = "Offline Address Book" Then
'use online or offline version
'Get address entry from the GAL
Set objAddr = _
objAddrList.AddressEntries(objSession.CurrentUser.Name)
Item.UserProperties("Req Phone") = _
objAddr.Fields(CdoPR_BUSINESS_TELEPHONE_NUMBER)
exit for
End If
Next
objSession.Logoff
set objSession = Nothing
End If
End Function

Could you tell me how I go about obtaining the equivilent information
as:

myOlApp.Application.GetNamespace("MAPI").CurrentUser.Name

And

objAddr.Fields(CdoPR_BUSINESS_TELEPHONE_NUMBER)

Through redemption? I have been going through whatever Redemption
documentation I could find but so far to no avail...

Thanks

David Buddrige :cool:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top