PC Review


Reply
Thread Tools Rate Thread

CDO/Redemption and embedded graphics Outlook XP

 
 
Kristy
Guest
Posts: n/a
 
      20th Nov 2003
I am using Exchange 2000, Windows XP, and have written a Com add-in
for Outlook 2000/2002(VB6). I am also using the re-distributable
version of Outlook Redemption.

Currently I am using CDO and an excellent code example from "Neo" to
embed a graphic into a new email (and also on reply and forward).
Because of the security patch I now want to use Outlook Redemption
instead of CDO.

Using the example provided at http://www.dimastr.com/redemption I have
successfully changed the code for new messages to something like
this...

Set DraftsFolder = Application.Session.GetDefaultFolder(16)
Set MailItem = DraftsFolder.Items.Add
Set sItem = CreateObject("Redemption.SafeMailItem")
sItem.item = MailItem

'Hide paper clip
PT_BOOLEAN = 11
PR_HIDE_ATTACH = sItem.GetIDsFromNames("{00062008-0000-0000-C000-000000000046}",
&H8514) Or PT_BOOLEAN
sItem.Fields(PR_HIDE_ATTACH) = True

'add attachment
Set attach = sItem.Attachments.Add(TemplateDir & EmailLogoType)
'content type
attach.Fields(&H370E001E) = "image/jpeg"
attach.Fields(&H3712001E) = "ABC"
sItem.HTMLBody = "<IMG align=right border=0 hspace=0 src=cid:ABC>"
sItem.Save
EID = sItem.EntryID

'de-reference the old item
Set attach = Nothing
Set sItem = Nothing
Set MailItem = Nothing
Set DraftsFolder = Nothing

'display email
Set sItem = Application.Session.GetItemFromID(EID)
sItem.Display

Call EmailLetterheadIdentifier
Call InsertSignatures

' clean up sItem
Set sItem = Nothing


However having applied this to Reply I am getting a box and cross
instead of the graphic being embedded when I display the email. If I
send it and then open it, it displays as expected with the graphic
embedded. Any ideas on why it doesn't display correctly initially?
Code for reply is the same except for instead of creating an Item in
the drafts folder, I use the current item.

Set oReply = objItem.Reply
Set sItem = CreateObject("Redemption.SafeMailItem")
sItem.item = oReply


Also, when using the 'Hide paperclip' code with both cdo and
redemption it doesn't always work. When I send from one exchange
server to another external exchange server the paper clip is visible
(internally it's fine, when from a non exchange environment to
exchange it's fine, or when sent from exchange to non-exchange
environment it works also - all clients being Outlook)?

One more question... does anyone know if you can programmatically
insert the default signature using Outlook Redemption - I'm currently
using commandbar controls to do this but am having some problems
calling this programmatically from another click event.

Thank you
 
Reply With Quote
 
 
 
 
Dmitry Streblechenko
Guest
Posts: n/a
 
      20th Nov 2003
Most likely Outlook caches a bunch of data at the time objItem.Reply is
called and does not see any changes made by Redemption.
You are already resetting all variables to Nothing and using GetItemFromId
to reopen the message, to take care of the possible implicit variables
created by the compiler, try to move the code creating the message to a
separate sub (this way all implicit variables will be dereferenced when the
sub exists), then reopen the message outside of that sub.

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


"Kristy" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I am using Exchange 2000, Windows XP, and have written a Com add-in
> for Outlook 2000/2002(VB6). I am also using the re-distributable
> version of Outlook Redemption.
>
> Currently I am using CDO and an excellent code example from "Neo" to
> embed a graphic into a new email (and also on reply and forward).
> Because of the security patch I now want to use Outlook Redemption
> instead of CDO.
>
> Using the example provided at http://www.dimastr.com/redemption I have
> successfully changed the code for new messages to something like
> this...
>
> Set DraftsFolder = Application.Session.GetDefaultFolder(16)
> Set MailItem = DraftsFolder.Items.Add
> Set sItem = CreateObject("Redemption.SafeMailItem")
> sItem.item = MailItem
>
> 'Hide paper clip
> PT_BOOLEAN = 11
> PR_HIDE_ATTACH =

sItem.GetIDsFromNames("{00062008-0000-0000-C000-000000000046}",
> &H8514) Or PT_BOOLEAN
> sItem.Fields(PR_HIDE_ATTACH) = True
>
> 'add attachment
> Set attach = sItem.Attachments.Add(TemplateDir & EmailLogoType)
> 'content type
> attach.Fields(&H370E001E) = "image/jpeg"
> attach.Fields(&H3712001E) = "ABC"
> sItem.HTMLBody = "<IMG align=right border=0 hspace=0 src=cid:ABC>"
> sItem.Save
> EID = sItem.EntryID
>
> 'de-reference the old item
> Set attach = Nothing
> Set sItem = Nothing
> Set MailItem = Nothing
> Set DraftsFolder = Nothing
>
> 'display email
> Set sItem = Application.Session.GetItemFromID(EID)
> sItem.Display
>
> Call EmailLetterheadIdentifier
> Call InsertSignatures
>
> ' clean up sItem
> Set sItem = Nothing
>
>
> However having applied this to Reply I am getting a box and cross
> instead of the graphic being embedded when I display the email. If I
> send it and then open it, it displays as expected with the graphic
> embedded. Any ideas on why it doesn't display correctly initially?
> Code for reply is the same except for instead of creating an Item in
> the drafts folder, I use the current item.
>
> Set oReply = objItem.Reply
> Set sItem = CreateObject("Redemption.SafeMailItem")
> sItem.item = oReply
>
>
> Also, when using the 'Hide paperclip' code with both cdo and
> redemption it doesn't always work. When I send from one exchange
> server to another external exchange server the paper clip is visible
> (internally it's fine, when from a non exchange environment to
> exchange it's fine, or when sent from exchange to non-exchange
> environment it works also - all clients being Outlook)?
>
> One more question... does anyone know if you can programmatically
> insert the default signature using Outlook Redemption - I'm currently
> using commandbar controls to do this but am having some problems
> calling this programmatically from another click event.
>
> Thank you



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Embedded graphics in Outlook 2007 running on WinXP PeterL Microsoft Outlook 6 20th May 2008 01:58 PM
Outlook reply delay when embedded graphics are in email =?Utf-8?B?a25vdGhvbGU=?= Microsoft Outlook Discussion 0 25th Sep 2006 07:18 PM
Save embedded graphics in Outlook 2007 Beta 2 =?Utf-8?B?SmF6Q2F0?= Microsoft Outlook Discussion 1 18th Jun 2006 07:57 AM
Why doesn't my Outlook send embedded graphics? =?Utf-8?B?Y3JlZ2cgc3RlZmZsZXI=?= Microsoft Outlook Discussion 1 27th Sep 2004 12:09 PM
Embedded messages not saved properly with Redemption Mat Farabee Microsoft Outlook Program Addins 3 14th Jul 2004 07:21 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:17 PM.