Macro to send an Outlook folder

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





*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
E

Eric Legault [MVP - Outlook]

Do you mean you want to send all of the items in a folder as an attachment to
one message?
 
M

Mike M

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.


*** Sent via Developersdex http://www.developersdex.com ***
 
W

Wolfram Jahn

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
 
S

Sue Mosher [MVP-Outlook]

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
 
W

Wolfram Jahn

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
 
S

Sue Mosher [MVP-Outlook]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top