Discussion:
message with RTF in outbox disables rich text control?
(too old to reply)
nigel
2010-03-21 20:39:01 UTC
Permalink
i develop a VAR application that sends emails on behalf of the user (using
outlook automation usually via outlook redemption).

An increasing number of customers are coming up with an error (0x8000405
unspecified error) when same program tries to instantiate a richtext object
while emails are still in the outbox (or in drafts folder).

Or at least that is my initial diagnosis.

The richtext component seems fine. It was used to create the message body of
the original email and that email is sent ok.
Subsequent attempts to use the richtext control will work once the outbox is
empty.

But trying to instantiate the richtext component gives that error whilst my
RTF emails are in the outbox.

I first saw this about 3 months ago at one customer only.... but in the last
week another 3 or 4 have reported it. Is it being spread with an update?

This is using MS's own richtx32.ocx.

In an attempt to get around this the program switches the bodyformat to HTML
(once body has been set using the rtf string.) but that doesn't appear to be
helping.

Help !

nigel
Ken Slovak - [MVP - Outlook]
2010-03-22 12:58:34 UTC
Permalink
Without seeing any relevant code all anyone could do is take a guess. It
sounds like you aren't releasing one or more object references to the
outgoing emails that you are trying to reuse.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm
Post by nigel
i develop a VAR application that sends emails on behalf of the user (using
outlook automation usually via outlook redemption).
An increasing number of customers are coming up with an error (0x8000405
unspecified error) when same program tries to instantiate a richtext object
while emails are still in the outbox (or in drafts folder).
Or at least that is my initial diagnosis.
The richtext component seems fine. It was used to create the message body of
the original email and that email is sent ok.
Subsequent attempts to use the richtext control will work once the outbox is
empty.
But trying to instantiate the richtext component gives that error whilst my
RTF emails are in the outbox.
I first saw this about 3 months ago at one customer only.... but in the last
week another 3 or 4 have reported it. Is it being spread with an update?
This is using MS's own richtx32.ocx.
In an attempt to get around this the program switches the bodyformat to HTML
(once body has been set using the rtf string.) but that doesn't appear to be
helping.
Help !
nigel
nigel
2010-03-22 14:53:03 UTC
Permalink
Ken,

the relevant (VFP) code is posted below. Basically copied from Dmitry's
redemption examples. All objects released.

I should emhasise that i can't recreate the problem and about 1000 other
customers don't experience it either. Latest customer to complain had been
using this same code and version for a few months then started getting this
last week.

Just picking up on your reply..... i'm not trying to reuse or reopen
existing emails. One email has been sent (with body that was originally RTF)
and now i'm trying to create new RTF which will be sent in body of new email.


The code that fails is a simple createobject on the rich text control in the
calling code.


LOCAL
loOutlook,loNS,loMailItem,lcSaveEditor,lcOutlook,lcKeyPath,llRetVal,loUtils,loSafeItem,i,loAttach

loOutlook = THIS.CREATEoutlook()
loNS = loOutlook.getnamespace("MAPI")
loNS.logon()


loMailItem = loOutlook.CreateItem(0) && omailitem
loSafeItem = CREATEOBJECT("Redemption.SafeMailItem")
loSafeItem.ITEM = loMailItem
loSafeItem.subject = THIS.subject
IF !EMPTY(THIS.TO)
FOR i=1 TO GETWORDCOUNT(THIS.TO,";")
=loSafeItem.Recipients.ADD(GETWORDNUM(THIS.TO,i,";"))
NEXT
ENDIF
IF !EMPTY(THIS.cc)
FOR i=1 TO GETWORDCOUNT(THIS.cc,";")
locc=loSafeItem.Recipients.ADD(GETWORDNUM(THIS.cc,i,";"))
locc.TYPE=2
release locc
NEXT i

ENDIF

IF !EMPTY(THIS.bcc)
loSafeItem.bcc = THIS.bcc
ENDIF

loSafeItem.bodyformat = 3 && RTF
loSafeItem.rtfbody = THIS.body
loSafeItem.SAVE()
lcEntryID = loSafeItem.entryid
loSafeItem = NULL
loMailItem = NULL
loMailItem = loNS.getitemfromid(lcEntryID)
loSafeItem = CREATEOBJECT("Redemption.SafeMailItem")
loSafeItem.ITEM = loMailItem
loSafeItem.bodyformat = 2 && HTML

IF THIS.Dialogue OR loSafeItem.Recipients.COUNT=0
loSafeItem.DISPLAY()
ELSE
loSafeItem.SEND()
losafeitem.close(0)
ENDIF

RELEASE loSafeItem
RELEASE loMailItem
RELEASE loNS
RELEASE loOutlook
Post by Ken Slovak - [MVP - Outlook]
Without seeing any relevant code all anyone could do is take a guess. It
sounds like you aren't releasing one or more object references to the
outgoing emails that you are trying to reuse.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm
Post by nigel
i develop a VAR application that sends emails on behalf of the user (using
outlook automation usually via outlook redemption).
An increasing number of customers are coming up with an error (0x8000405
unspecified error) when same program tries to instantiate a richtext object
while emails are still in the outbox (or in drafts folder).
Or at least that is my initial diagnosis.
The richtext component seems fine. It was used to create the message body of
the original email and that email is sent ok.
Subsequent attempts to use the richtext control will work once the outbox is
empty.
But trying to instantiate the richtext component gives that error whilst my
RTF emails are in the outbox.
I first saw this about 3 months ago at one customer only.... but in the last
week another 3 or 4 have reported it. Is it being spread with an update?
This is using MS's own richtx32.ocx.
In an attempt to get around this the program switches the bodyformat to HTML
(once body has been set using the rtf string.) but that doesn't appear to be
helping.
Help !
nigel
.
Ken Slovak - [MVP - Outlook]
2010-03-22 18:15:01 UTC
Permalink
If things are failing on CreateObject() we usually find there are anti-virus
script stoppers. However that's not the case if the same code works
sometimes and not others. Script stoppers would be a universal failure, as
long as they're running.

If this is new for customers that have been running OK for a while and you
haven't changed your code it could be an update or some new software that
was installed that's messing things up. I'd look for something like that.
There has to be something different now on those failing systems than there
was before.

I've seen uninstalling code that used Redemption from managed code causing
problems with other managed addins even if Redemption was customized, but
that fails everything all the time, not sometimes. And that's with managed
code, not COM code like VFP code.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm
Post by nigel
Ken,
the relevant (VFP) code is posted below. Basically copied from Dmitry's
redemption examples. All objects released.
I should emhasise that i can't recreate the problem and about 1000 other
customers don't experience it either. Latest customer to complain had been
using this same code and version for a few months then started getting this
last week.
Just picking up on your reply..... i'm not trying to reuse or reopen
existing emails. One email has been sent (with body that was originally RTF)
and now i'm trying to create new RTF which will be sent in body of new email.
The code that fails is a simple createobject on the rich text control in the
calling code.
LOCAL
loOutlook,loNS,loMailItem,lcSaveEditor,lcOutlook,lcKeyPath,llRetVal,loUtils,loSafeItem,i,loAttach
loOutlook = THIS.CREATEoutlook()
loNS = loOutlook.getnamespace("MAPI")
loNS.logon()
loMailItem = loOutlook.CreateItem(0) && omailitem
loSafeItem = CREATEOBJECT("Redemption.SafeMailItem")
loSafeItem.ITEM = loMailItem
loSafeItem.subject = THIS.subject
IF !EMPTY(THIS.TO)
FOR i=1 TO GETWORDCOUNT(THIS.TO,";")
=loSafeItem.Recipients.ADD(GETWORDNUM(THIS.TO,i,";"))
NEXT
ENDIF
IF !EMPTY(THIS.cc)
FOR i=1 TO GETWORDCOUNT(THIS.cc,";")
locc=loSafeItem.Recipients.ADD(GETWORDNUM(THIS.cc,i,";"))
locc.TYPE=2
release locc
NEXT i
ENDIF
IF !EMPTY(THIS.bcc)
loSafeItem.bcc = THIS.bcc
ENDIF
loSafeItem.bodyformat = 3 && RTF
loSafeItem.rtfbody = THIS.body
loSafeItem.SAVE()
lcEntryID = loSafeItem.entryid
loSafeItem = NULL
loMailItem = NULL
loMailItem = loNS.getitemfromid(lcEntryID)
loSafeItem = CREATEOBJECT("Redemption.SafeMailItem")
loSafeItem.ITEM = loMailItem
loSafeItem.bodyformat = 2 && HTML
IF THIS.Dialogue OR loSafeItem.Recipients.COUNT=0
loSafeItem.DISPLAY()
ELSE
loSafeItem.SEND()
losafeitem.close(0)
ENDIF
RELEASE loSafeItem
RELEASE loMailItem
RELEASE loNS
RELEASE loOutlook
nigel
2010-03-22 20:23:02 UTC
Permalink
Ken,

yes i looked as best i could but couldn't see anything. And i don't have
easy access to any of the PCs running my software.

By posting here i was hoping that someone from MS would recognise a recent
outlook update....

n
Post by Ken Slovak - [MVP - Outlook]
If things are failing on CreateObject() we usually find there are anti-virus
script stoppers. However that's not the case if the same code works
sometimes and not others. Script stoppers would be a universal failure, as
long as they're running.
If this is new for customers that have been running OK for a while and you
haven't changed your code it could be an update or some new software that
was installed that's messing things up. I'd look for something like that.
There has to be something different now on those failing systems than there
was before.
I've seen uninstalling code that used Redemption from managed code causing
problems with other managed addins even if Redemption was customized, but
that fails everything all the time, not sometimes. And that's with managed
code, not COM code like VFP code.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm
Post by nigel
Ken,
the relevant (VFP) code is posted below. Basically copied from Dmitry's
redemption examples. All objects released.
I should emhasise that i can't recreate the problem and about 1000 other
customers don't experience it either. Latest customer to complain had been
using this same code and version for a few months then started getting this
last week.
Just picking up on your reply..... i'm not trying to reuse or reopen
existing emails. One email has been sent (with body that was originally RTF)
and now i'm trying to create new RTF which will be sent in body of new email.
The code that fails is a simple createobject on the rich text control in the
calling code.
LOCAL
loOutlook,loNS,loMailItem,lcSaveEditor,lcOutlook,lcKeyPath,llRetVal,loUtils,loSafeItem,i,loAttach
loOutlook = THIS.CREATEoutlook()
loNS = loOutlook.getnamespace("MAPI")
loNS.logon()
loMailItem = loOutlook.CreateItem(0) && omailitem
loSafeItem = CREATEOBJECT("Redemption.SafeMailItem")
loSafeItem.ITEM = loMailItem
loSafeItem.subject = THIS.subject
IF !EMPTY(THIS.TO)
FOR i=1 TO GETWORDCOUNT(THIS.TO,";")
=loSafeItem.Recipients.ADD(GETWORDNUM(THIS.TO,i,";"))
NEXT
ENDIF
IF !EMPTY(THIS.cc)
FOR i=1 TO GETWORDCOUNT(THIS.cc,";")
locc=loSafeItem.Recipients.ADD(GETWORDNUM(THIS.cc,i,";"))
locc.TYPE=2
release locc
NEXT i
ENDIF
IF !EMPTY(THIS.bcc)
loSafeItem.bcc = THIS.bcc
ENDIF
loSafeItem.bodyformat = 3 && RTF
loSafeItem.rtfbody = THIS.body
loSafeItem.SAVE()
lcEntryID = loSafeItem.entryid
loSafeItem = NULL
loMailItem = NULL
loMailItem = loNS.getitemfromid(lcEntryID)
loSafeItem = CREATEOBJECT("Redemption.SafeMailItem")
loSafeItem.ITEM = loMailItem
loSafeItem.bodyformat = 2 && HTML
IF THIS.Dialogue OR loSafeItem.Recipients.COUNT=0
loSafeItem.DISPLAY()
ELSE
loSafeItem.SEND()
losafeitem.close(0)
ENDIF
RELEASE loSafeItem
RELEASE loMailItem
RELEASE loNS
RELEASE loOutlook
.
Ken Slovak - [MVP - Outlook]
2010-03-23 13:13:27 UTC
Permalink
These groups are peer to peer, they aren't inhabited by MS support people.
If you want MS support you can open a case with them, but unless they'd have
access to the problem machines or very comprehensive logs they couldn't do
anything but take guesses either.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm
Post by nigel
Ken,
yes i looked as best i could but couldn't see anything. And i don't have
easy access to any of the PCs running my software.
By posting here i was hoping that someone from MS would recognise a recent
outlook update....
n
Loading...