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
315 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 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Issue with Outlook Mail 13 53
Excel 2016 - Black cell borders 11 27
exchange, outlook 7 40
Outlook importing calendar entries 6 65
Microsoft Office Picture Manager is not included in Office 2013. This comes as a shock to users upgrading from earlier versions of Office, such as 2007 and 2010, where Picture Manager was included as a standard application. This article explains how…
Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.

910 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now