[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

redemption.dll and security alert messages

Posted on 2009-02-13
8
Medium Priority
?
537 Views
Last Modified: 2012-05-06
Hi,

I understand that redemption.dll library is the way for safe operations in outlook VBA programming.  Sometimes it works strange way it might be possible that I am missing something.  Could any one tell me in below code why it is printing Body as empty string?

Private Sub Application_ItemSend(ByVal Item As Object, _
                                 Cancel As Boolean)      
    Dim redAppt As Redemption.SafeMailItem
    Set redAppt = CreateObject("Redemption.SafeMailItem")
    redAppt.Item = Item            
    MsgBox "subject1: " & redAppt.Subject
    MsgBox "subject1: " & redAppt.Body    //Always print empty string
End Sub

I also tried with MessageItem but no luck. Could you also tell me what is the difference between SafeMailItem and MessageItem?

Private Sub Application_ItemSend(ByVal Item As Object, _
                                 Cancel As Boolean)      
    Dim redAppt As Redemption.MessageItem
    Set redAppt = CreateObject("Redemption.MessageItem")
    redAppt.Item = Item            
    MsgBox "subject1: " & redAppt.Subject
    MsgBox "subject1: " & redAppt.Body    //Always print empty string
End Sub

Thanks
0
Comment
Question by:deshaw
  • 5
  • 3
8 Comments
 
LVL 11

Accepted Solution

by:
DavidT543 earned 2000 total points
ID: 23641171
I use redemption daily and it looks fine to me.

I presume it prints the subject - showing that it has found the item (ie it is not null)
I also presume you have put some data in the body of the message (ie the main message window of the email)
What message are you sending? I am looking at your redAppt and wondering if it is not an ordinary message but a meeting request for example. Not sure how this might work with safeMailItem.

You could try .HTMLBody and .rtfBody instead of .Body, but I would expect them all to have data in - not only one of them.

I would be debugging by setting a breakpoint on the first msgbox and adding a watch to redAppt. Check out which fields are available and what their values are. IOf Body isn't there, or is empty there I it might give some cluse as to where tha data is that you were expecting
0
 
LVL 1

Author Comment

by:deshaw
ID: 23643910
Thanks for reply. All your presumptions are valid.
>>What message are you sending?
I am sending just normal messages. Please note that Item.Body prints correct body message but it alerts security message. and thats a reason I used redemption library and assigned Item to it.
>>You could try .HTMLBody and .rtfBody instead of .Body,
I have tried everything but for all it prints null for all.
Like you, I also use Redemption.dll extensively but I have problem only in given code while sending item. I think there something to do with  " redAppt.Item = Item " but not sure whats going wrong.
Private Sub Application_ItemSend(ByVal Item As Object, _
                                 Cancel As Boolean)      
    Dim redAppt As Redemption.SafeMailItem
    Set redAppt = CreateObject("Redemption.SafeMailItem")
    redAppt.Item = Item            
    MsgBox "subject1: " & redAppt.Subject
    MsgBox "subject1: " & redAppt.Body    //Always print empty string
End Sub
Thanks.
0
 
LVL 11

Expert Comment

by:DavidT543
ID: 23644715
What about if you debug and use a breakpoint on the msgbox. If you set a watch on redAppt - what fields can you see? What is the contents of body?

Which version of redemption are you using?

Where are you calling it from? Is this an external executable, or a COM add-in or a VBA macro
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 1

Author Comment

by:deshaw
ID: 23647139
Hi, Please find the answers to your questions.
>>If you set a watch on redAppt - what fields can you see?
It is really weird. I cannot see Subject in the field but Body is available. Though redAppt.Subject field gives the Subject value correctly.
One more thing I noticed is, Item itself contain only subject line(when i keep mouse o redAppt.Item = Item line it shows me the subject as a contents.)
>>What is the contents of body?
When I keep mouse on redAppt.Subject it don't show anything but redAppt.Body show "" string.
>>Which version of redemption are you using?
It is 4.7.0.1026 and I downloaded developer version from http://www.dimastr.com/redemption/download.htm
I have also tried with older version and got same behaviour for all.
>>Where are you calling it from?
If you noticed, I am using it in Application_ItemSend event and it is VBA ofcourse macro placed under ThisOutlookSession.
Could you please try below simple macro in your outlook session and let me know if it works for you.

Private Sub Application_ItemSend(ByVal Item As Object, _
                                Cancel As Boolean)      
    Dim redAppt As Redemption.SafeMailItem
   Set redAppt = CreateObject("Redemption.SafeMailItem")
   redAppt.Item = Item            
   MsgBox "subject: " & redAppt.Subject
   MsgBox "body:" & redAppt.Body    'Always print empty string
End Sub  
Thanks for being there.
0
 
LVL 1

Author Comment

by:deshaw
ID: 23647158
Hi DavidT543,
It works perfect when I have added Item.Save at start of the function. Thanks for being there. Assigning you full points.
Thanks,
Paresh
0
 
LVL 1

Author Comment

by:deshaw
ID: 23647181
Hi DavidT543, One question for you :)
I noticed that it is not working with V4.1.0.507 but works with V4.7.0.1026. Could you tell me why it is so?
Thanks,
0
 
LVL 11

Expert Comment

by:DavidT543
ID: 23651080
Hi Paresh,

4.1 was a very old version (3 years old) with lots of features missing, and un-fixed bugs.
4.7 is a new version just released today - I haven't even seen it yet.

But the problem with your code may well have been the version rather than the item.save

I just looked at the Bugs it fixes and it fixes a bug I was having with unicode characters - so you have helped me as well.

Its good to converse with a fellow Redemption user.

Cheers Paresh

David
0
 
LVL 1

Author Closing Comment

by:deshaw
ID: 31546505
Thanks for you time David.
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Take a look at these 6 Outlook Email management tools which can augment the working and performance of Microsoft Outlook to give you a more rewarding emailing experience.
This article will help to fix the below errors for MS Exchange Server 2016 I. Certificate error "name on the security certificate is invalid or does not match the name of the site" II. Out of Office not working III. Make Internal URLs and Externa…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
Many of my clients call in with monstrous Gmail overloading issues with Outlook. A quick tip is to turn off the All Mail and Important folders from synching. Here is a quick video I made to show you how to turn off these and other folders in Gmail s…
Suggested Courses

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question