Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / February 2007

Tip: Looking for answers? Try searching our database.

Excel macro to attach files in Outlook 2000

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
atif.ahbab@gmail.com - 26 Jan 2007 16:11 GMT
Hi there,

Trying to get the VBA command in Excel macro below to add an attachment
in Outlook 2000. The attachment needs to be read from a location in the
Excel file. My friend used the command below but works for Outlook in
XP and not in 2000 it seems.

.Attachments.Add CStr(ActiveCell.Offset(0, 4).Value)

The Cstr thing doesn't seem to work in 2000.

This is what I have so far:

With olMyEmail
   .To = ActiveCell.Text
   .CC = ActiveCell.Offset(0, 1).Text
   .Subject = ActiveCell.Offset(0, 2).Text
   .Body = ActiveCell.Offset(0, 3).Text
   .Attachments.Add -----> NEED HELP HERE TO LOCATE FILE IN EXCEL CELL
   .Save
   End With

Thanks in advance.
Chad - 20 Feb 2007 20:47 GMT
I would try setting up an input to bring in the attachment destination.  For
example:
mynewattachment=range("A1").value 'or whereever the location is
Then, i would try to attach it as follows (in place of .Attachments.Add in
your code):
Set myAttachments = OutMail.Attachments
myAttachments.Add mynewattachment

Hope this helps!
-Chad

> Hi there,
>
[quoted text clipped - 19 lines]
>
> Thanks in advance.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.