Get details of sent items with Access VBA

Status
Not open for further replies.

Fritz

New Member
Outlook version
Outlook 2010 64 bit
Email Account
POP3
I have an access program that sends emails with Outlook.
I need to get details from each email that was sent today.
I I am looking for VBA code to do the following. From there on I can do the rest.

I want to say:
For each message in outlook.sentmail
TimeSent =
EmailAddress =
Subject =
AttachmentName =
Debug.Print TimeSent, EmailAddress, Subject, AttachmentName
Next message

Can you help me please
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
That's not hard. you need outlook's senton, to, subject - attachment name is from the attachment collection so it needs an extra line. I have samples of all both here and at slipstick.com

Debug.Print item.sento item.subject item.to

If Item.Attachments.Count > 0 Then
For Each oAtt In Item.Attachments
Debug.Print oAtt.Name
Next oAtt
end if
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
F VBA to move email from Non Default folder to Sub folders as per details given in excel file Outlook VBA and Custom Forms 11
A Day view - print appointment details Using Outlook 1
I print calendar without subject and details Using Outlook 1
nathandavies Email Details to Excel & Save as .MSG on one macro - combination of 2 macros Outlook VBA and Custom Forms 3
N Export details to a excel spreadsheet using macros Using Outlook 0
Diane Poremsky VBA: Get All Contact Details Using Outlook 0
V move emails to windows folder and show sender details Using Outlook 7
P Outlook 2010 intermittently asking for my login details Using Outlook 12
J Can invitee edit details? Using Outlook 1
L Business Contact Mnager losing contact details BCM (Business Contact Manager) 1
V Extracting user-defined details from a public folder Outlook VBA and Custom Forms 2
S Requried a VBA Code to export Calander details to excel... Outlook VBA and Custom Forms 4
S Outlook Macro details Using Outlook 3
M details with the combo box Exchange Server Administration 3
B Birthday dates automatically (and improperly) placed in Birthday Details Using Outlook 2
R Surely you can print details/Body? Using Outlook 0
B modifying print template for printing out appointment details Using Outlook 2
R Need code to gather value of custom field on addressentry.details dialog box Using Outlook 3
D Accessing Global Address List details with VBA Outlook VBA and Custom Forms 1
V how to collect details from user, during installation of office addin? Outlook VBA and Custom Forms 1
N Incorporating user details from AD into an Outlook Form Outlook VBA and Custom Forms 4
P Contact Details from Appointment Item Outlook VBA and Custom Forms 1
S hide details of appointments in calendar Using Outlook 8
S Record eMail details in Outlook 2007 Outlook VBA and Custom Forms 5
Q Completed details on form don't show on reply Outlook VBA and Custom Forms 1
B IMAP server rejects sent email - cannot deliver messages Using Outlook 2
S How to find emails that I sent that have not received a reply? Using Outlook 7
M Extract "Date sent" from emails (saved to folder using drag and drop) Outlook VBA and Custom Forms 1
R Sent emails show iCloud mail account not the alias Using Outlook 2
L Images not displaying in emails sent to self Using Outlook 2
S Outlook 2016 A Shortcut to recall and delete and sent message. Using Outlook 1
J Names in sent items suddenly show as Bob Smith (bobsmith@sample.com) Using Outlook 3
M Messages Intermittently Dont Arrive In Sent Items After Sending Successfully Using Outlook 4
D Outlook 2016 Outlook not saving Sent Items Using Outlook 4
A Is there an ID field you can use to pair a reply to the sent email? Outlook VBA and Custom Forms 4
T Changing Sent Items location in Outlook 2019 Using Outlook 0
S Outlook (2016 32bit; Gmail IMAP) - Save sent message to Outllook Folder Outlook VBA and Custom Forms 0
C VBA to prompt for Sent folder destination Outlook VBA and Custom Forms 3
MrMayor SENT mail not reloading to top?? Using Outlook 4
D Mail in Sent Items Gone Using Outlook 12
A calendar invites sent from Microsoft Outlook to Mac Outlook is not working Using Outlook 2
Terry Sullivan E-Mails Sent Using a Group Box Result in 70 Kickbacks Using Outlook 4
GregS Outlook 2016 Sent Mail absent from Sent Mail or Sent Items Folders Using Outlook 4
P Outlook for Mac - emails are not sent out beginning last week Using Outlook 1
J Sent Items Folder NOT Showing Correct From Email Address Using Outlook 0
J Outlook Reply > From > Other Email Address... > Address Not Showing in Sent Items... From Email Outlook VBA and Custom Forms 0
T Column to display which email alias a message was sent to Outlook VBA and Custom Forms 6
GregS Outlook 2016 Sent Items vs Sent Messages Using Outlook 2
N Disable Auto Read Receipts sent after using Advanced Find Using Outlook 4
R Outlook for Mac - Advanced Search and Tracking Sent Emails Using Outlook 0

Similar threads

Top