Redemption access to contacts in Public folder

  • Thread starter Thread starter Phil
  • Start date Start date
P

Phil

I am trying to iterate through the contacts of a public folder to get
the e-mail addresses using Redeption but get the security pop-up.

A cut down version of the code I am using is below

Dim objItem As MAPI.Message
Dim objSession As MAPI.Session
Dim objNormFolder As MAPI.Folder
Dim utils As Redemption.MAPIUtils
Dim objFolder As Redemption.MAPIFolder

Set objSession = New MAPI.Session
objSession.Logon , , , , , , "Server" & vbLf & "Mailbox"

Set utils = CreateObject("Redemption.MAPIUtils")
utils.MAPIOBJECT = objSession.MAPIOBJECT

Set objNormFolder =
objSession.InfoStores(1).RootFolder.Folders.Item(2).Folders.Item(8)

Set objFolder = New Redemption.MAPIFolder
objFolder.Item = objNormFolder

Set objItem = objFolder.Messages(1) <==== Security pop-up here

The problem is that the last line results in the security pop-up.

Any ideas what I am doing wrong?
 
Many thanks for your prompt reply - one hopefully quick further
followup

I now wish to extract e-mail addresses (type and value). I assume
that I need to use the Fields member but can't work out what prop tag
to use.

Phil.
 
Look at the message using OutlookSpy (click IMessage button). Select the
property that you are after and note the GUID and id.
You can then call MessageItem.GetIDsFromNames() passing the GUId and id,
"or" the returned tag with the correct prop type (e.g. PT_STRING8 = 0x1E).
After that you can use it in MessageItem.Fields(). See
http://www.dimastr.com/redemption/utils.htm#xmapi and scroll to "Named
Properties".

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Back
Top