Consulting

Results 1 to 3 of 3

Thread: sending more recent documents, different types, in one mail

  1. #1

    sending more recent documents, different types, in one mail

    First of all, thanks to everyone who would help me because I'm new to this programming. I would like to create a macro (_onClick) in the MS Word document, which will enclose 2 or more recently created documents from the same folder with a different extension (.zip, .txt, .xls) in the mail and will be in one mail. Each requested file starts with "EXAM"
    Can anyone help this beginner?
    Tnx

  2. #2
    Quote Originally Posted by le_marc0507 View Post
    First of all, thanks to everyone who would help me because I'm new to this programming. I would like to create a macro (_onClick) in the MS Word document, which will enclose 2 or more recently created documents from the same folder with a different extension (.zip, .txt, .xls) in the mail and will be in one mail. Each requested file starts with "EXAM"
    Can anyone help this beginner?
    Tnx

  3. #3
    This solution is primal but works. Can someone help me and simplify this

    ....

    ' Check date on each file on each extension in folder.
    For Each objFile In objFolder.Files
    If objFile.DateLastModified > varDate And objFSO.GetExtensionName(objFile) = "zip" And Left(objFile.Name, 5) = "EXAM" Then
    varDate = objFile.DateLastModified
    strName = objFile.Name
    End If
    Next

    For Each objFile1 In objFolder1.Files
    If objFile1.DateLastModified > varDate1 And objFSO.GetExtensionName(objFile1) = "txt" And Left(objFile1.Name, 5) = "EXAM" Then
    varDate1 = objFile1.DateLastModified
    strName1 = objFile1.Name
    End If
    Next

    With OutMail
    .to = ""
    .CC = ""
    .BCC = ""
    .Subject = ""
    .Body = ""
    .Attachments.Add (strPath & strName)
    .Attachments.Add (strPath & strName1)
    .Display
    End With

Posting Permissions

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