G
Gabriel
Someone can tell which i´m doing wrong with this code. It works great
when i´m create a new mail with attachments but when i forward or
reply mails with files the first mail takes the fields attributes and
it´s lost and the company logo figures as an attach instead to be
embeded.
Function NuevoEnvio()
Dim oSession
Dim oMapiItem
Dim colAttachs
Dim oAttach
Dim colFields
Dim oField
Dim cantidad
Const CdoPR_ATTACH_MIME_TAG = &H370E001E
Set colAttachs = Item.Attachments
cantidad = colAttachs.count
colAttachs.Add("\\public\Imagenes\companylog.gif")
Item.Save 'create EntryID
Set colAttachs = Nothing 'dereference before using MAPI
set oSession = CreateObject("MAPI.Session")
oSession.Logon ,,false,false,0
Set oMapiItem = oSession.GetMessage(Item.EntryID)
Set colAttachs = oMapiItem.Attachments
Set oAttach = colAttachs(1)
'Set oAttach = colAttachs(cantidad)
Set colFields = oAttach.Fields
Set oField = colFields.Add(CdoPR_ATTACH_MIME_TAG, "image/gif")
Set oField = colFields.Add(&H3712001E, "myimage")
oMapiItem.Fields.Add "{0820060000000000C000000000000046}0x8514", 11,
True
oMapiItem.Update
oMapiItem.Send
Set oMapiItem = Nothing
oSession.Logoff
Set oSession = Nothing
End Function
Thanks in advance
when i´m create a new mail with attachments but when i forward or
reply mails with files the first mail takes the fields attributes and
it´s lost and the company logo figures as an attach instead to be
embeded.
Function NuevoEnvio()
Dim oSession
Dim oMapiItem
Dim colAttachs
Dim oAttach
Dim colFields
Dim oField
Dim cantidad
Const CdoPR_ATTACH_MIME_TAG = &H370E001E
Set colAttachs = Item.Attachments
cantidad = colAttachs.count
colAttachs.Add("\\public\Imagenes\companylog.gif")
Item.Save 'create EntryID
Set colAttachs = Nothing 'dereference before using MAPI
set oSession = CreateObject("MAPI.Session")
oSession.Logon ,,false,false,0
Set oMapiItem = oSession.GetMessage(Item.EntryID)
Set colAttachs = oMapiItem.Attachments
Set oAttach = colAttachs(1)
'Set oAttach = colAttachs(cantidad)
Set colFields = oAttach.Fields
Set oField = colFields.Add(CdoPR_ATTACH_MIME_TAG, "image/gif")
Set oField = colFields.Add(&H3712001E, "myimage")
oMapiItem.Fields.Add "{0820060000000000C000000000000046}0x8514", 11,
True
oMapiItem.Update
oMapiItem.Send
Set oMapiItem = Nothing
oSession.Logoff
Set oSession = Nothing
End Function
Thanks in advance