If no attachment do not send email

Posted on 2006-05-02
Last Modified: 2010-04-08
what is the sysntac to check if there is an attachment? Normally I save it in a filepath. So if that file path is empty do not send the email.

thanks for your help
Question by:zachvaldez
    LVL 76

    Expert Comment

    by:David Lee
    Hi zachvaldez,

    > what is the sysntac to check if there is an attachment?
    Do you mean from code?  I'm also not understanding what a file paht has to do with the existence, or lack thereof, of an attachment.


    Author Comment

    I rephrase my question..
    If the attachment is < 100 kb
    then do not send the email...
    LVL 76

    Accepted Solution

    You didn't answer my question, so I'll assume you want to make this test from code and not from a rule.  Testing for the existence of an attachment is done like this:

        if Item.Attachments.Count = 0 Then

    You can't check a path or a size since the test would cause errors if there is not attachment.

    Author Comment

    blue, your're right.
    I did the other way but same solution you propose

    If .attachment.count>0 then
    end if

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    My experience with Windows 10 over a one year period and suggestions for smooth operation
    Find out how to use dynamic social media in email signatures with this top 10 DOs & DON’Ts.
    Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
    This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

    755 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

    17 Experts available now in Live!

    Get 1:1 Help Now