Page 1 of 2 12 LastLast
Results 1 to 15 of 22
  1. #1
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Send all files in directory one at a time (2000)

    I have a mass of files that have been accruing...it's about time to send them all, and they're all going to the same address. What I'm hoping to accomplish is to create a button that will create a new mail message to the address I specify (in code), add the first of X number of files as an attachment, use the attachment name as the subject line (or I'll specify a subject if necessary), and send the email.

    A secondary desire would be to have the file moved to a new directory (I.e. a file names "Sent") after they are sent.... I've never done any automation in Outlook, so <img src=/S/please.gif border=0 alt=please width=31 height=23> <img src=/S/help.gif border=0 alt=help width=23 height=15>!
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What&#39;s more, you deserve to be hacked." -Richard Clarke

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Send all files in directory one at a time (2000)

    Why not zip the files and send them in one go?

  3. #3
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Send all files in directory one at a time (2000)

    There's about 100, each at 2mb. Plus, our exchange server isn't the greatest, sending emails over 10mb is prohibited.
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What&#39;s more, you deserve to be hacked." -Richard Clarke

  4. #4
    Super Moderator
    Join Date
    Dec 2000
    Location
    Renton, Washington, USA
    Posts
    12,560
    Thanks
    0
    Thanked 4 Times in 4 Posts

    Re: Send all files in directory one at a time (2000)

    If these are all going to the same email address, I would not like to be on the receiving end, even on a cable connection.

    Do these files need to be this large?
    I send reduced size in email and if the original size is needed I will snail mail a CD.

    Now running HP Pavilion a6528p, with Win7 64 Bit OS.

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Send all files in directory one at a time (2000)

    I agree with Dave, the files will fit nicely on a CD, while sending 200 MB by mail will be a horror whichever way you do it.

  6. #6
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Send all files in directory one at a time (2000)

    The recipient is an automated system that will open the attachments, and grade them. (I'm sending answer sheets to tests)...snail mail from Iraq to the US takes entirely too long...in the future, the folder won't get that big.
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What&#39;s more, you deserve to be hacked." -Richard Clarke

  7. #7
    Super Moderator
    Join Date
    Dec 2000
    Location
    Renton, Washington, USA
    Posts
    12,560
    Thanks
    0
    Thanked 4 Times in 4 Posts

    Re: Send all files in directory one at a time (2000)

    Now that we have the WHOLE story, I see why you need the full size copy.

    Now running HP Pavilion a6528p, with Win7 64 Bit OS.

  8. #8
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Send all files in directory one at a time (2000)

    <img src=/S/yep.gif border=0 alt=yep width=15 height=15>...sorry I was playing hard to get with my explanation... Any ideas?
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What&#39;s more, you deserve to be hacked." -Richard Clarke

  9. #9
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Send all files in directory one at a time (2000)

    The target address is constant, correct? I've got bit's and pieces of related code that I can cobble together, but it will take me a while. Hans, other the other hand(s), can probably write the 1,000 lines of code in 2 minutes! <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

    As a starter, the first declaration and sub in the attachment to <post#=502022>post 502022</post#> has some hacked API code to grab multiple selected files, though the rest of the code does something different.
    -John ... I float in liquid gardens
    UTC -7ąDS

  10. #10
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Send all files in directory one at a time (2000)

    Any help would be greatly appreciated. I checked out the code your referred to, sadly, most of it is Greek to me...
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What&#39;s more, you deserve to be hacked." -Richard Clarke

  11. #11
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Send all files in directory one at a time (200

    While I think John is in a better position to help with grabbing the attachments, you can start by first creating a message in the correct format with the correct recipient and saving it somewhere convenient as a template (.OFT) file. Then, when you are ready with the other code, you can create the new messages using the template file to bypass some of the painful security restrictions on setting the recipient fields.

    Dim msg As MailItem
    ' Loop through all potential attachments
    ' ... your code here
    ' Create message from pre-addressed template
    Set msg = CreateItemFromTemplate(TemplateFileName)
    msg.Display
    ' Attach the file and send it off
    ' ...your code here

  12. #12
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Send all files in directory one at a time (2000)

    Due to a little work crisis which I did not create but am expected to resolve, I didn't get to this until now, and it's not as polished as I would like (since the crisis is not resolved). See attachment, and note the comments regarding a valid recipient name (i.e., the person on the TO line) matching the Display name in the Contact Folder or GAL.

    Outlook VBA guys, can you help with this, as I won't be back in the Lounge until my little work issue is resolved?
    -John ... I float in liquid gardens
    UTC -7ąDS

  13. #13
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Send all files in directory one at a time (2000)

    YOU are our Outlook VBA guy! <img src=/S/evilgrin.gif border=0 alt=evilgrin width=15 height=15>

  14. #14
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Send all files in directory one at a time (2000)

    My lack of knowledge in Outlook is sickening. How do I use all of that? <img src=/S/blush.gif border=0 alt=blush width=15 height=15> <img src=/S/sorry.gif border=0 alt=sorry width=15 height=15>
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What&#39;s more, you deserve to be hacked." -Richard Clarke

  15. #15
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Send all files in directory one at a time (2000)

    Copy it verbatim into in a regular Module in the Outlook VBE. See if <!post=this Post,398131>this Post<!/post> helps with the steps.
    -John ... I float in liquid gardens
    UTC -7ąDS

Page 1 of 2 12 LastLast

Posting Permissions

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