Results 1 to 5 of 5

Thread: Chosing Attachment Based On Condition Before Sending Mail In Outlook

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,401
    Rep Power
    10
    Add this to the module

    Code:
    Function SubjToPass(strSituation As String, Optional lngOutlier As Long)
    
        Dim str As String
        Select Case strSituation
            Case ">30"
            If lngOutlier > 1 Then
                SubjToPass = "Multiple workflows with more than 30 days"
            ElseIf lngOutlier = 1 Then
                SubjToPass = "Single WF with more than 30 days"
            End If
            Case "<=30"
                SubjToPass = "Workflows without more than 30days"
            End Select
            
    End Function
    And in the subject line, use

    Code:
    .Subect = SubjToPass(strSituation, lngOutlier)
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

  2. #2
    Junior Member
    Join Date
    Feb 2013
    Posts
    5
    Rep Power
    0
    I have edited the macro, but when i save the macro to our shared folders, the macro won't work, do you have idea why? also there are cases which the macro work,

    1. if i create a new file, copying all macro, then it works, but when i transfered or save the file from ather share folders, the macro is not working.
    2. if it is save and wont work, i am running the VBA, then the open sheet is "Mailinfo" the macro is running but it copies the date from the said sheet.
    Attached Files Attached Files

Similar Threads

  1. Replies: 26
    Last Post: 10-22-2019, 02:39 PM
  2. Replies: 6
    Last Post: 06-05-2013, 11:33 PM
  3. Check for Missing Attachment and Subject in Outlook
    By Transformer in forum Tips, Tricks & Downloads (No Questions)
    Replies: 0
    Last Post: 05-17-2013, 12:32 AM
  4. Formula Based On Condition
    By Aryan063007 in forum Excel Help
    Replies: 4
    Last Post: 10-09-2012, 10:37 AM
  5. Replies: 3
    Last Post: 02-20-2012, 12:54 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •