Go Premium for a chance to win a PS4. Enter to Win

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
?
332 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
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

With its various features, Office 365 can not only help you with your day-to-day business tasks, it can also do wonders for your marketing campaign.
Are you looking for the options available for exporting EDB files to PST? You may be confused as they are different in different Exchange versions. Here, I will discuss some options available.
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…
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…

877 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