K
Kristy
Hi
I am using Windows XP and writing a com add-in for Outlook 2000 and
XP, I am also using Outlook Redemption.
I am having a few problems embedding a graphic, the code works
perfectly when I create a new item, but I need to attach the graphic
and then embed it into an existing item. I am getting no error
messages but the new files are not getting attached and therefore
cannot be embedded.
The code looks something like this...
Set MailItem = objNamespace.GetItemFromID(EID)
Set sItem = CreateObject("FSRedemption.FSMailItem")
sItem.item = MailItem
'Hide paperclip
PT_BOOLEAN = 11
PR_HIDE_ATTACH = sItem.GetIDsFromNames("{00062008-0000-0000-C000-000000000046}",
&H8514) Or PT_BOOLEAN
sItem.Fields(PR_HIDE_ATTACH) = True
'NO ERROR MESSAGES AND IT APPEARS TO BE THERE BUT THE FILE IS NOT
BEING ATTACHED
Set attach = sItem.Attachments.Add "C:\Temp.jpg"
'content type
attach.Fields(&H370E001E) = "image/jpeg"
'Attachment cid
attach.Fields(&H3712001E) = "Graphic1"
sItem.Save
EID2 = sItem.EntryID
Set MailItem = Nothing
Set sItem = Nothing
Set attach = Nothing
Set sItem = golApp.Session.GetItemFromID(EID2)
sItem.HTMLBody = "<IMG align=baseline border=0 hspace=0
src=cid:"Graphic1">"
sItem.Display
I just can't seem to get the files to attach to the existing MailItem,
they just simply aren't there and therfore I get a box with a red
cross instead of my graphic.
When the item is newly created ('Set MailItem =
golApp.CreateItem(olMailItem)', instead of 'Set MailItem =
objNamespace.GetItemFromID(EID)') it works so what is the difference
between using a newly created Item and an existing Item when attaching
files in this way? I have tried moving things around, displaying the
Item first, and using separate subs but to no avail, I hope that
someone can spot the error that I am missing!
Thank you
Kristy
I am using Windows XP and writing a com add-in for Outlook 2000 and
XP, I am also using Outlook Redemption.
I am having a few problems embedding a graphic, the code works
perfectly when I create a new item, but I need to attach the graphic
and then embed it into an existing item. I am getting no error
messages but the new files are not getting attached and therefore
cannot be embedded.
The code looks something like this...
Set MailItem = objNamespace.GetItemFromID(EID)
Set sItem = CreateObject("FSRedemption.FSMailItem")
sItem.item = MailItem
'Hide paperclip
PT_BOOLEAN = 11
PR_HIDE_ATTACH = sItem.GetIDsFromNames("{00062008-0000-0000-C000-000000000046}",
&H8514) Or PT_BOOLEAN
sItem.Fields(PR_HIDE_ATTACH) = True
'NO ERROR MESSAGES AND IT APPEARS TO BE THERE BUT THE FILE IS NOT
BEING ATTACHED
Set attach = sItem.Attachments.Add "C:\Temp.jpg"
'content type
attach.Fields(&H370E001E) = "image/jpeg"
'Attachment cid
attach.Fields(&H3712001E) = "Graphic1"
sItem.Save
EID2 = sItem.EntryID
Set MailItem = Nothing
Set sItem = Nothing
Set attach = Nothing
Set sItem = golApp.Session.GetItemFromID(EID2)
sItem.HTMLBody = "<IMG align=baseline border=0 hspace=0
src=cid:"Graphic1">"
sItem.Display
I just can't seem to get the files to attach to the existing MailItem,
they just simply aren't there and therfore I get a box with a red
cross instead of my graphic.
When the item is newly created ('Set MailItem =
golApp.CreateItem(olMailItem)', instead of 'Set MailItem =
objNamespace.GetItemFromID(EID)') it works so what is the difference
between using a newly created Item and an existing Item when attaching
files in this way? I have tried moving things around, displaying the
Item first, and using separate subs but to no avail, I hope that
someone can spot the error that I am missing!
Thank you
Kristy