Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel macro to attach files in Outlook 2000

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.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 273
Default Excel macro to attach files in Outlook 2000

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

" wrote:

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.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I attach an Outlook email to an Excel cell? katneils Excel Discussion (Misc queries) 2 January 15th 08 07:20 PM
Can you attach an alert to a date in excel(eg to outlook calendar Total Excel Dunce Excel Discussion (Misc queries) 2 May 31st 07 05:29 AM
Automatically attach Excel spreadsheet to Outlook Email with Macro? nbaj2k[_2_] Excel Programming 6 August 1st 06 04:41 PM
Sending tasks from Excel 2000 to Outlook 2000 [email protected] Excel Programming 2 April 20th 06 06:50 PM
I want to attach word files or PDF files to an excel database Dianne Munro Excel Discussion (Misc queries) 1 March 23rd 06 12:11 AM


All times are GMT +1. The time now is 04:02 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"