Outlook freezes on Redemption SaveAs

C

charles.lanteigne

Hi,

I have been using Outlook Redemption for about a year now and it's been
incredibly useful in the development of an add-in for Outlook
2K/XP/2003. I am trying to retrieve the e-mail (well actually, only the
recipients, body and attachments) that is being composed by the user
and export an RFC822 version of it.

For months my code was actually extracting the various parts of the
message I needed, reconstructing it using CDO (cdosys.dll), and getting
the RFC822 stream that CDO would provide. It worked "fairly" well
(considering the fact that I had to deal with different body formats,
different attachment types, etc.). But then I found out there was a
much easier way to do it: simply use the SaveAs() method of a
SafeMailItem object.

It litterally cut my code in half, it is much cleaner, faster,
efficient! But I recently found a bug I had never encountered with that
method. On two machines running Windows XP with Outlook 2000, calling
the SaveAs() method freezes Outlook -- we have to kill it using the
task manager. (The issue is not related specifically to either Windows
XP nor Outlook 2000, because it worked fine on other computers running
them.) It is also not an issue with filename or write permissions,
because I can OpenForOutput/Print/Close the same file in plain VB.

I know of a couple of ways to make Outlook or the add-in crash when
trying to save a MailItem (like using Outlook's built-in encryption,
and then trying to save it programmatically), but this one, I had never
encountered. I am now clueless about what I should do to fix this
issue. I don't want to have to go back to my old bulky code... What are
the possible reasons for this SaveAs() method to fail or to have a
similar behavior?

(I hope Dmitry Streblechenko sees this!)

Thanks!!
 
D

Dmitry Streblechenko

What is your version of Redemption? When your code hangs, does CPU
utlization go to 100%?

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

charles.lanteigne

Hi (I'm so glad to hear from you!),

We're using the latest version (4.1.0.507). (We upgraded when we found
out there were some issues with the attachments when using that same
SaveAs() with the earlier Redemption we were using.) I made perfectly
sure that was the right version used by displaying it with
MAPIUtils.Version.

Unfortunately, I cannot access the computers on which it occurred right
now, they are at some client's office! (By now, they've tested it on a
third, apparently "clean" machine, and it failed exactly the same way.)
What I know is that when I played with it yesterday, I could right-clic
on the taskbar's button and choose "Close", which would immediately pop
up the "Not responding" window, and then it would quit really quickly.
So it doesn't appear as if the CPU was working real hard.

- Charles
 
D

Dmitry Streblechenko

Does this happen with the same messages or with any message on these
machines?
Redemption 4.1 uses IConverterSession (provided by Outlook) to perform the
the MIME conversion - there is a bug there that causes an unusually slow
processing of some messages. It eventually finishes, but it can take a while
(hours?). IConverterSession is available in Outlook 2002 and up; in the
previous versions of Outlook built-in MIME conversion code is used by
Redemption.
I am not aware of similar issues in Redemption - since you are using Outlook
2000, Redemption seems to be the culprit. Is there any chance you can try to
install Outlook 2002 or 2003 and see if this still happens?

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

charles.lanteigne

It happens with every message/any message.
I will see if they can try what you've o-suggested (install Outlook 10
or 11 and try again) and write you back.

For the moment, I've patched back my old "extraction" code and it
should work -- but of course I prefer the SaveAs() method.

I am using Outlook 2003 during development. Comparing the two outputs
(one using SafeMailItem.SaveAs() and the other using
IMessage.GetStream().SaveToFile()), I've noticed that using the
SaveAs() method strips accented characters from recipient names,
whereas my alternate solution (using CDO) automatically encodes the
names in quoted-printable (which is a good thing).

By the way Redemption is an essential tool in Outlook programming -- if
I can be of any help identifying how to reproduce these issues, I'd be
glad. I'd probably have a couple of questions for other problems I've
encountered in the last year, for which I've found some workaround
solutions (which were not always pretty).

- Charles
 

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