Macro to send an Outlook folder

  • Thread starter Thread starter Mike M
  • Start date Start date
M

Mike M

I have a macro (see below) I use in Outlook 2003 to automatically send
some external files via email, and it works fine. Is there a way to use
a similiar macro to send a specific Outlook folder, such as the Calendar
folder?

Sub SendFiles()
Dim myItem As Outlook.MailItem
Dim myAttachments As Outlook.Attachments

Set myItem = Application.CreateItem(olMailItem)
Set myAttachments = myItem.Attachments

myItem.Recipients.Add "<email address>"
myItem.Subject = "Files"

myAttachments.Add "<path and filename, repeated for each file>"

myItem.Send

Set myItem = Nothing
Set myAttachments = Nothing

End Sub
 
Do you mean you want to send all of the items in a folder as an attachment to
one message?
 
I was hoping I could just send the entire folder, but I've been told
that's not possible. I guess the next best thing is to send all of the
items in that folder as attachments.

What I'm trying to do is make it easy to send the Calendar contents from
home to my office, so I can keep a copy of my families personal calendar
(which my wife maintains at home) at my office. I'm currently using an
external calendar program for this, and use the current macro to send
those files from home to the office. I was hoping to switch to Outlook,
but still have the ability to quickly send all of the items from home to
the office.
 
Mike said:
What I'm trying to do is make it easy to send the Calendar contents from
home to my office, so I can keep a copy of my families personal calendar
(which my wife maintains at home) at my office. I'm currently using an
external calendar program for this, and use the current macro to send
those files from home to the office. I was hoping to switch to Outlook,
but still have the ability to quickly send all of the items from home to
the office.

Export your calendar folder (and everything else you want to have) into
a .pst file, send the .pst as email attachment, detach at home, and
reimport.


Wolfram
 
Can't be done programmatically. Mike was asking for an automated solution.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Sue said:
Can't be done programmatically. Mike was asking for an automated solution.
I'm sure that you are right, but I found the addstore method of the
namespace object. Can Mike use this to automate my idea?

Wolfram
 
No, because the store can't be completely disconnected from Outlook while Outlook is running.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Back
Top