attaching e-mails to new e-mail using VBA

Status
Not open for further replies.
H

Hii Sing Chung

Dear all,

I need to use VBA to iterate through the inbox and attach all mails that has

a specific subject and specific 'SentOn' value (same date and time) to a new

mail. So far I've seen codes that attach files into e-mail, but how do I

attach e-mails to e-mail?

Thanks in advance.

Sing Chung
 
D

Dmitry Streblechenko

Instead of passing the file name to Attachments.add, pass the message

(MailItem object) to be added.

Dmitry Streblechenko (MVP)

-

"Hii Sing Chung" <singchung@hotmail.com> wrote in message

news:0563D648-8F1F-4B26-A5E9-16DD6632F11E@microsoft.com...
> Dear all,

> I need to use VBA to iterate through the inbox and attach all mails that
> has a specific subject and specific 'SentOn' value (same date and time) to
> a new mail. So far I've seen codes that attach files into e-mail, but how
> do I attach e-mails to e-mail?

> Thanks in advance.

> Sing Chung
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
R Shortcut for attaching the same file repeatedly Using Outlook 6
M re-Attaching PSTs after upgrade to 2016 Using Outlook 0
P Outlook Randomly Not attaching (attachment file) Using Outlook 0
D Attaching date named files Using Outlook 3
L Creating a Task from Email and Attaching Original Email Outlook VBA and Custom Forms 6
D Attaching email conversations to tasks Using Outlook 2
A Attaching mail items in Outlook 2010 Outlook VBA and Custom Forms 5
J Attaching Files to Outlook Outlook VBA and Custom Forms 1
D Tab Order Out of Sequence After Attaching Document Outlook VBA and Custom Forms 1
D Outlook 2007 Recovering E-Mails Using Outlook 0
H Outlook 2016 related mails in outlook Outlook VBA and Custom Forms 13
F Excel VBA to move mails for outlook 365 on secondary mail account Outlook VBA and Custom Forms 1
T E-mails marked as read turn back to unread after a couple of seconds Using Outlook 1
M Outlook 2010 How could I globally redesign an outlook template form/region/inspector template used to display mail lists or an individual mails? Outlook VBA and Custom Forms 0
L Macro to add Date & Time etc to "drag to save" e-mails Outlook VBA and Custom Forms 17
S Outlook Macro to send auto acknowledge mail only to new mails received to a specific shared inbox Outlook VBA and Custom Forms 0
Eike Move mails via macro triggered by the click of a button? Outlook VBA and Custom Forms 0
Terry Sullivan E-Mails Sent Using a Group Box Result in 70 Kickbacks Using Outlook 4
T Search for incoming e-mails for a specified time range Using Outlook 1
F Outlook 2016 Junk E-Mails Using Outlook 5
RBLampert Invisible e-mails in Gmail accounts Using Outlook 0
P when i move inbox mails to another folder in outlook the mail disappears Using Outlook 1
I How to receive mails on behalf of when sent to group mail? Using Outlook 2
A Script to fetch data from mails in restricted collection and sending them to excel Using Outlook 1
O Having rules run on old mails noved to inbox Outlook VBA and Custom Forms 8
R Would creating a new profile cause Outlook to download all the old mails from the server? Using Outlook 1
C VBA to Forward e-mails from certain address and between certain times Outlook VBA and Custom Forms 1
O Copy mails from many subfolders to 1 foldr Using Outlook 2
S Outlook [Online - Office365] perfomance is getting affected when accessing the mails using Redemptio Using Outlook 1
F Move mails from Deleted Items folder back to its original folder where the mails got deleted Using Outlook 0
Thiago Manzano Copying E-mails to a folder on HD Using Outlook 1
A Processing Incoming E-mails with Macros Using Outlook 0
O Outlook 2013 Problems sending large mails Using Outlook 4
P Send mails by Gmail not shown in outlook Using Outlook 5
E How to find or recover Lost e-mails within a folder under Inbox? Using Outlook 2
Karsten V invites from outside company arrives as regular mails Using Outlook 2
A Encrypting mails depending from the address Outlook VBA and Custom Forms 0
Yusufbodrum Highlighting selected mails in any folder Using Outlook 2
C Linking e-mails BCM (Business Contact Manager) 1
S Mails getting downloaded multiple times Using Outlook 1
K Macro doesn't recognize local mails from colleagues Outlook VBA and Custom Forms 2
I Delete e-mails from server Using Outlook 2
W URGENT Cancel and remove imported pop3 mails Using Outlook 6
T Cannot get pop3 mails to my Android and Outlook Exchange Server Administration 1
A 1 folder to see all new mails Using Outlook 1
Z OL2007 - is there a way to disable the "feature" that cripples mails that are in the "junk" folder? Using Outlook 37
A Contacts missing in imported mails Using Outlook 1
L Selected Contacts For E-Mails Using Outlook 19
L Move E-Mails to Another Folder Using Outlook 66
J Change Subject of 500 mails sitting in Outbox with Macro Using Outlook 6

Similar threads

Top