OL Redemption - Attachments Invisible

M

Mike Vest

Any Outlook Redemption Experts out there???
(I hear the expert hangs out at this news group.)



Using Outlook Redemption with Windows 2000, Outlook 2002 / Exchange
Server.

I use the following code to attach files to the email. I then display
the email for the user to edit and click the SEND button.

Unfortunately - the displayed email does not show the attachments. So,
the user gets concerned thinking the requested files are not attached.

Actually - the attachements are there, but the user just can't see
them. When the user presses SEND, the attachements show up in the
recpient's mailbox.

THE PROBLEM IS THAT THE ATTACHED FILES CANNOT BE SEEN WHEN THE EMAIL
IS DISPLAYED BEFORE SENDING.

Thanks For Your Help!!

Attached Code:
Set OL_app = CreateObject("Outlook.Application")
Set OL_item = OL_app.CreateItem(0) 'Create a new message
Set NameSpace = OL_app.GetNamespace("MAPI")
NameSpace.Logon

'Create an instance of Redemption.safeMailItem
Set safeItem = CreateObject("Redemption.safeMailItem")
safeItem.Item = OL_item 'set Item property

' add TO list to email
For i = LBound(toList) To UBound(toList)
If StrComp(toList(i), "", vbTextCompare) <> 0 Then Set safeRecip
= safeItem.Recipients.Add(toList(i))
Next i

' add CC list to email
For i = LBound(ccList) To UBound(ccList)
If StrComp(toList(i), "", vbTextCompare) <> 0 Then
Set ccRecip = safeItem.Recipients.Add(ccList(i))
ccRecip.Type = olCC
End If
Next i

' resolve distribution
safeItem.Recipients.ResolveAll

' add attachement files to email
For i = LBound(attList) To UBound(attList)
If StrComp(attList(i), "", vbTextCompare) <> 0 Then
safeItem.Attachments.Add (attList(i))
Next i

' add subject header to email
safeItem.subject = subject

' add body message to email
safeItem.Body = body_msg

safeItem.Display
 
D

Dmitry Streblechenko

Outlook cannot see any modifications made through Extended MAPi until you
dereference and reopen the message.
Since adding attachments is not blocked by the Outlook Object Model, replace
the line
safeItem.Attachments.Add (attList(i))
with
OL_item.Attachments.Add (attList(i))

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

Mike Vest

Thanks! Works great and so does Redemption - bravo work.

My secretary will be licensing a copy asap.

I will be securing it via the suggestions on your website. If there
are any issues, I'll post.

-Mike
 

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