LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 599
Default Timestamp from Outlook

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
timestamp james Excel Worksheet Functions 2 May 17th 09 06:16 PM
Timestamp juanpablo Excel Discussion (Misc queries) 3 November 2nd 07 01:55 PM
Timestamp Sher Excel Discussion (Misc queries) 2 November 3rd 06 04:31 PM
Now as timestamp Lp12 Excel Worksheet Functions 5 August 13th 06 11:32 AM
timestamp tommyboy[_3_] Excel Programming 6 July 7th 04 10:19 AM


All times are GMT +1. The time now is 02:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"