Problem with MapiTable and OL2000

P

Peter Marchert

Hello,

I try to use the MapiTable object in OL 2000, but get an error on the
ExecSQL statement: "HrGetPropTag: MAPIProp == NULL". Same code on
2002/2003 works without error, so I don`t know where to search. Does
MapiTables not work on 2000?

I tried it with an exchange post box and with a pst file - same
result.

Here is the code:

Public Sub GetDaslProperty()

Const DASLGUID As String = "{41B067EB-BDC6-472C-8989-
BAC7B8F788EE}"
Const DASLPROPERTY As String = "http://schemas.microsoft.com/mapi/
string/" & DASLGUID & "/" & "Test"

Dim objTable As Object
Dim objRecordset As Object

Dim strSQL As String

Set objTable = CreateObject("Redemption.MAPITable")

objTable.Item =
Outlook.Session.GetDefaultFolder(olFolderCalendar).Items

strSQL = "SELECT """ & DASLPROPERTY & """ FROM Folder"

Set objRecordset = objTable.ExecSQL(strSQL)

End Sub

Redemption version is 4.5.0.730

Thanks for answers!

Peter
 
K

Ken Slovak - [MVP - Outlook]

How are you assigning the RDOSession object, are you using
NameSpace.MAPIOBJECT? That doesn't exist in Outlook 2000, there you have to
use RDOSession.Logon.
 
P

Peter Marchert

Hmm, have I forgot something? Do I need a RDOSession for MapiTables?

Peter
 
D

Dmitry Streblechenko

The problem here is that if you are using the standalone
Redemption.MAPITable object (rather than RDOItems.MAPITable property) and
assign its Item property to an instance of the Outlook.Items object,
Redemption will need to convert the named property GUID/id to a 4 bytes int
tag using IMAPIProps::GetIDsFromNames. To do that, it will attempt to query
the Parent property of the object assigned to the Item property (for the
Outlook.Items object Parent property will return Outlook.MAPIFolder), and
try to retrieve the IMAPIFolder Extended MAPI object from the MAPIOBJECT
property. The problem here is that Outlook.MAPIFolder object added the
MAPIOBJECT property in Outlook 2002.
You can work around this by opening a message (any message) from that folder
and using MAPIUtils or SafeMailItem object to call GetIdsFromNames and
hardcode the tag in the form like

http://schemas.microsoft.com/mapi/proptag/0x85990003

You will essentially treat a named property as a regular property and
handcode its value.

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

Peter Marchert

Thanks, Dmirty. The workaround seems for me to complicated so I will
create RDOFolderItems and use these.

Thanks, Ken, too.

Peter
 

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