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
322 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 500 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

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…
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

623 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