Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Mails when send the sent email will be stored in an alternative place. that code errors when unknown email id's thats out of office or Meeting requests are sent or accepted

Posted on 2010-08-18
2
Medium Priority
?
326 Views
Last Modified: 2012-05-10
Hi,

Mails when send the sent email will be stored in an alternative place. that code errors when unknown email id's thats out of office or Meeting requests are sent or accepted.
Run time error 438
Object doen't support this property or method

When debug goes here

    Set Item.SaveSentMessageFolder = Application.Session.Folders("sent New").Folders("Sent")

regards
Sharath
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
    Dim olkRecipient As Outlook.Recipient
    Set Item.SaveSentMessageFolder = Application.Session.Folders("sent New").Folders("Sent")
    For Each olkRecipient In Item.Recipients
        LogAddress olkRecipient.Name, olkRecipient.Address
    Next
    Set olkRecipient = Nothing
    toMe Item
    If Not bolBulkMail Then
        If (Not bolReadReceipt) And (Not bolDeliveryReceipt) Then
            If MsgBox("Do you want receipts for this message?", vbQuestion + vbYesNo, "Request Receipts") = vbYes Then
                Item.ReadReceiptRequested = True
                Item.OriginatorDeliveryReportRequested = True
            End If
        Else
            Item.ReadReceiptRequested = bolReadReceipt
            Item.OriginatorDeliveryReportRequested = bolDeliveryReceipt
        End If
    End If
    'CheckFollowUp Item, Cancel
    Item.Save
End Sub

Open in new window

0
Comment
Question by:bsharath
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 59

Accepted Solution

by:
Chris Bottomley earned 2000 total points
ID: 33467435
How about limiting it to emails as below?

Chris
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim olkRecipient As Outlook.Recipient
    if item.class <> olmail then exit sub
    Set Item.SaveSentMessageFolder = Application.Session.Folders("sent New").Folders("Sent")
    For Each olkRecipient In Item.Recipients
        LogAddress olkRecipient.Name, olkRecipient.Address
    Next
    Set olkRecipient = Nothing
    toMe Item
    If Not bolBulkMail Then
        If (Not bolReadReceipt) And (Not bolDeliveryReceipt) Then
            If MsgBox("Do you want receipts for this message?", vbQuestion + vbYesNo, "Request Receipts") = vbYes Then
                Item.ReadReceiptRequested = True
                Item.OriginatorDeliveryReportRequested = True
            End If
        Else
            Item.ReadReceiptRequested = bolReadReceipt
            Item.OriginatorDeliveryReportRequested = bolDeliveryReceipt
        End If
    End If
    'CheckFollowUp Item, Cancel
    Item.Save
End Sub

Open in new window

0
 
LVL 11

Author Comment

by:bsharath
ID: 33467515
Thanks Chris
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

This article will help to fix the below errors for MS Exchange Server 2013 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…
Cancel future meetings from user mailboxes in Office 365 using Remove-CalendarEvents
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

705 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