Home |
Search |
Today's Posts |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Steph
So that being said, and my ignorance for this level of coding, can you help me? The appendage to the end of the time would be nice if 2 e-mails arrive at the same time. So is it easy to append my code to save the file name as the ReceivedTime (plus possibly the end # appendage)?? Once you've identified an email with an attachment to save, try something like this lUnique = 1 Do sFname = Format(mi.ReceivedTime, "yyyymmddhhmmss") & lUnique & ".xls" lUnique = lUnique + 1 Loop Until Len(Dir(sPath & sFname)) = 0 mi.Attachments(1).SaveAsFile sPath & sFname where mi is MailItem variable. This loops adding a larger number to the end of the proposed filename until it comes upon a file name that doesn't exist. -- Dick Kusleika MVP - Excel Excel Blog - Daily Dose of Excel www.dicks-blog.com |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
timestamp | Excel Worksheet Functions | |||
Timestamp | Excel Discussion (Misc queries) | |||
Timestamp | Excel Discussion (Misc queries) | |||
Now as timestamp | Excel Worksheet Functions | |||
timestamp | Excel Programming |