Outlook 2002 crashes when accessing Redemption.AddressEntry -> workaround?

C

Carsten Hecht

Hi,

I have experienced a serious problem with Outlook 2002 (10.0.0.4712;
part of Office XP + Multilingual User Interface Pack; running on Win
XP Build 2600). Whenever I access properties of
Redemption-AddressEntries of an outgoing meeting request or incoming
meeting response the above-mentioned Outlook installation crashes
after writing "Method '~' of object '~' failed" to the logfile. It
works fine with Outlook 2000 and other Outlook 2002 installations and
builds.

Microsoft says (http://support.microsoft.com/default.aspx?scid=kb;en-us;821470)
that there is a known problem with MAPI "when you run code that
impersonates a user to access a mailbox". This is exactly what I am
doing. So this might cause the crash.

As Redemption is based on MAPI it seems to be a victim. But I assume
that there must be a workaround as Outlook itself frequently accesses
address entries without crashing (well, in most cases ;-) and my code
works on other machines.

I have tried to clean up MAPI sessions according to
http://www.dimastr.com/redemption/faq.htm#5. But this doesn't help.

Is there a known workaround (using Redemption)?
Is there a specific SP, update... to be installed?

Thanks for your help!
 
P

Prashanth

Hi
did you got a solution to this problem

i am facing similar problem with Outlook XP(MUI-SP2)on Win XP.it works
fine with MUI set to english but outlook crashes when MUI set to any
other language.
i tried to put message boxes in the code and i noticed Outlook crashes
when Redemption objects has been created.

thanks in advance
Prashanth.
 
P

Prashanth

Hi
still not got the solution??
is still Dmitry is working on it.
any alternative thought for this,
b'cas time is running out for me

thanks in advance,
Prashanth
 
P

Prashanth

Hi Dmitry,

thanks for the concern and quick response.
i thought of posting code where exactly i am getting this error.

i am using Outlook XP Professional(SP-2) with Microsoft Office XP
German User Interface Pack on Microsoft Windows XP Professional SP-1.
the code works fine when my settings are in English.but if i change my
settings to German i will get the crash message.

i am using Redemption in Folder Homepage as well as in Custom forms.

sample code in Homepage:

set RedCUser = CreateObject ("Redemption.SafeCurrentUser")
myName = RedCUser.Name
RedCUser.Cleanup
Set RedCUser = Nothing

Dim oNewMessage
Dim SafeItem

Set myGAddressList = AddressLists(1)

Set oNewMessage = g_App.CreateItem(0)
Set SafeItem = CreateObject("Redemption.SafeMailItem")

SafeItem.Item = oNewMessage
SafeItem.Recipients.Add document.all.item("ApplAdmin").value
SafeItem.Recipients.ResolveAll

Set myGEntry = SafeItem.Recipients.Item(1)

If myGEntry.DisplayType = "1" Or myGEntry.DisplayType = "5" Then
For Each memberEntry In myGEntry.AddressEntry.Members
If memberEntry.Name = myName Then
admin.Style.Display = "inline"
Exit For
End If
Next
Else
If myGEntry.Name = myName Then
admin.Style.Display = "inline"
End If
End If


Set oNewMessage = Nothing
Set SafeItem = Nothing

like this i am using redemption for getting current user
details,looping thru the items in the folder,sending mails and many
more.

we have done lot of homework to convince the security team about
Redemption,now our major hurdle is to make Redemption work on
MUI,b'cas almost 90% of outlook installations are with MUI.

thanks a lot in advance,
Prashanth
 
P

Prashanth

Hi

i checked with putting message boxes i think the error is at this
line,b'cas myGEntry object is not getting intialised.but everything
works fine with English MUI.

Set myGEntry = SafeItem.Recipients.Item(1)

is there is anything wrong in intiating like this

thanks in advance,
Prashanth
 
D

Dmitry Streblechenko

Yes, that should be fine. BTW, instead of that line, you can instantiate
myGEntry using the previous line of code:

set myGEntry = SafeItem.Recipients.Add(document.all.item("ApplAdmin").value)

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

Prashanth

Hi
thanks for the reply,

i tried it out.when i did as what you said the object is not
instaniating properly(showing wrong DisplayType) because the
Recipients is not resolved yet.i noticed we have to resolve it first
and then assign it to myGEntry.so how to resolve it before assigning
to myGEntry object

set myGEntry = SafeItem.Recipients.Add(document.all.item("ApplAdmin").value)
'SafeItem.Recipients.ResolveAll

thanks in advance,
Prashanth
 
D

Dmitry Streblechenko

When do you get an error? Is it on a particular line of code or just happens
later?

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


Prashanth said:
Hi
DisplayType - i need to know whether the addressentry is a
DistributionList or normal entry.
should i have to do addressentry.cleanup

and also as you helped me in another problem in Outlook Dev yahoo
group regarding MAPI tables,even that is working fine in English MUI
but outlook becoming unstable when i run the same code in German MUI


dim Columns(0)
dim Row
dim Rows
dim sItem
dim oItem
dim Table

RestrtStr = ""
RestrtStr = "[MessageClass] = ""IPM.Post.Folders""" & " AND [Project
Name]
= """ & tmpPrjname & """"

Set oRestrictedItems = oCurrentFolder.Items.Restrict(RestrtStr)

set oItem = oRestrictedItems(1)
set sItem = CreateObject("Redemption.SafePostItem")
sItem.Item = oItem
PT_STRING8 = &H1E
PR_FILE_UNDER = sItem.GetIDsFromNames("{00020329-0000-0000-C000-
000000000046}", "Folder Title") or PT_STRING8
set Table = CreateObject("Redemption.MAPITable")
Table.Item = oRestrictedItems
Columns(0) = PR_FILE_UNDER
Table.Columns = Columns
Table.GoToFirst
Rows = Table.GetRows(Table.RowCount)
for i = LBound(Rows) to UBound(Rows)
Row = Rows(i)
If tmpValues = "" Then
tmpValues = Row(0)
Else
tmpValues = tmpValues & "," & Row(0)
End If
next
Set i = Nothing
Set oItem = Nothing
Set sItem = Nothing
Set Row = Nothing
Set Rows = Nothing
Set Table = Nothing
Set PT_STRING8 = Nothing
Set PR_FILE_UNDER = Nothing

whats wrong with this code??

thanks in advance,
Prashanth



"Dmitry Streblechenko" <[email protected]> wrote in message
What are you getting for DisplayType?

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


do as
you said.


Office
XP Professional
SP-1. Custom
forms. "5"
Then and
many

message
XP(MUI-SP2)on
Win when
MUI set noticed
Outlook
crashes
 

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