Save attachments using hotkey without changing attributes

Status
Not open for further replies.

ofw62

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
Current method:
open mail
select attachment(s)
save to
select folder
[OK]
close mail
next one ..

the date attributes of the files saved that in that way are updated to the date of saving (create/modified/access date)

Would there be a way to have these files saved
a. without having to open the mails on by one
b. preserve the original attributes, at least the creation date.

No doubt there are 3rd party tools (like EzDetach, payware) but I wonder whether there would be a native solution
or using a free script?

Office 365

I have noticed:
1. Article : Save and Rename Outlook Email Attachments with 3 scripts and many comments
first requiring
2. A registry patch outlined in Run-a-Script Rules Missing in Outlook

Now, after changing the registry, which script should I use?
I would like to have the name and then the created date added.
So, for example, file name reads: file-xyz.xlsx
the save as : file-xyz ddmmyyyy.xlsx (or file-xyz dd-mm-yyyy.xlsx)

Is this possible?

Thanks!
 
I would use the middle one - the run a script rule version. The first is manual, the last increments identical file names.

Adjusting the saved file name to meet your needs is generally easy enough
Code:
DateFormat = Format(Date, "yyyy-mm-dd ")

file = saveFolder & DateFormat & objAtt.DisplayName
Gives "date filename.ext" format. to do filename-date.ext format, you need to get the extension stick the date in before it.

you can use something like this from the first macro - it's actually better to get the position of the last dot then get the extension, unless you are only looking for specific file extensions.

Code:
For Each objAtt In itm.Attachments

' get the last 5 characters for the file extension
strExt = Right(objAtt.DisplayName, 4)

' clean the subject
strSubject = itm.Subject

ReplaceCharsForFileName strSubject, "-"
' put the name and extension together

file = saveFolder & strSubject & strExt

From another macro on the site - this would only save the ones that match the extensions.
Code:
' This code looks at the last 4 characters in a filename
      sFileType = LCase$(right$(objAtt.FileName, 4))

      Select Case sFileType

' Add additional file types below
      Case ".xls", ".doc", "docx"
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
S using script rule to save attachments on arrival Outlook 2010 Outlook VBA and Custom Forms 9
G Save and Rename Outlook Email Attachments Outlook VBA and Custom Forms 0
R Use an ItemAdd to Save Attachments on Arrival Outlook VBA and Custom Forms 0
W Save and rename outlook email attachments to include domain name & date received Outlook VBA and Custom Forms 4
J Save E-mail attachments in a specific folder Outlook VBA and Custom Forms 0
C Auto save outlook attachments when email is received Outlook VBA and Custom Forms 1
Diane Poremsky Save Messages and Attachments to a New Folder Using Outlook 0
B Delete/replace old files and save new attachments Using Outlook 1
Diane Poremsky Edit and Save Outlook's Read-Only Attachments Using Outlook 0
Diane Poremsky Save Attachments to the Hard Drive Using Outlook 2
C Rule To Save attachments on receipt of email Outlook VBA and Custom Forms 2
B Auto Save of Attachments from Multiple Emails and forward attachments to user group Outlook VBA and Custom Forms 1
Diane Poremsky Save Messages and Attachments to a New Folder Using Outlook 0
R Outlook 2013 VB rule to auto save attachments with different file types Outlook VBA and Custom Forms 5
C Save outlook attachments and rename/append files with identifier from subject line Outlook VBA and Custom Forms 3
M VBA code to save email attachments (PDF) as email subject line Outlook VBA and Custom Forms 1
D Save pst and attachments as a PDF File Outlook VBA and Custom Forms 3
E Outlook prompts to save attachments when no changes have been made. Using Outlook 0
M Save Attachments Event? Using Outlook 0
A File - Save Attachments does nothing in Outlook 2003 with Exchange 2010 ... Using Outlook 3
R VB code to bulk save attachments deletes message Using Outlook 1
O closing outlook prompts to save all opened attachments Using Outlook 2
M Outlook 2007 - Save outgoing attachments to network drive on sending? Using Outlook 1
S how to disable security message in save attachments macro "A programis trying to access e-mail addre Outlook VBA and Custom Forms 5
U Save messages and attachments for a date range Outlook VBA and Custom Forms 2
M save attachments code? Outlook VBA and Custom Forms 1
M Save as Adobe PDF misses inline graphics Using Outlook 0
Sandgroper48 Save vbaProject Outlook VBA and Custom Forms 2
J Outlook 2019 Pick the Folder Location to save send emails Outlook VBA and Custom Forms 0
boblewis Technical Issue with Custom Form - Save to Drafts Not Syncing Outlook VBA and Custom Forms 1
Rob Can't save MailItem because the message changed in .pst file Outlook VBA and Custom Forms 0
G Save emails as msg file from Outlook Web AddIn (Office JS) Outlook VBA and Custom Forms 0
E Outlook 365 Save Selected Email Message as .msg File - oMail.Delete not working when SEARCH Outlook VBA and Custom Forms 0
E Save Selected Email Message as .msg File - digitally sign email doesn't works Outlook VBA and Custom Forms 1
M Outlook Macro to save as Email with a file name format : Date_Timestamp_Sender initial_Email subject Outlook VBA and Custom Forms 0
C Outlook 365 Copy/Save Emails in Folder Outside Outlook to Show Date Sender Recipient Subject in Header Using Outlook 0
W Create a Quick Step or VBA to SAVE AS PDF in G:|Data|Client File Outlook VBA and Custom Forms 1
C Outlook (desktop app for Microsoft365) restarts every time I save my VBA? Using Outlook 1
D VBA Macro to Print and Save email to network location Outlook VBA and Custom Forms 1
N VBA Macro To Save Emails Outlook VBA and Custom Forms 1
N Save emails within a certain date range to network drive Outlook VBA and Custom Forms 0
T Outlook 365 Move newly created tasks automatically on save. Outlook VBA and Custom Forms 1
G Save attachment run a script rule Outlook VBA and Custom Forms 0
N Save Selected Email Message as .msg File Outlook VBA and Custom Forms 12
G VBA to save selected Outlook msg with new name in selected network Windows folder Outlook VBA and Custom Forms 1
D Outlook 2016 64bit, Cannot Save in 'HTML', format Using Outlook 1
N Save selected messages VBA does not save replies and/or messages that contain : in subject Outlook VBA and Custom Forms 1
L Macro to add Date & Time etc to "drag to save" e-mails Outlook VBA and Custom Forms 17
S save attachment with date & time mentioned inside the file Outlook VBA and Custom Forms 0
S Add VBA save code Using Outlook 0

Similar threads

Back
Top