View Single Post
  #11  
Old May 2nd 08, 09:15 PM posted to microsoft.public.outlook.program_forms
Marc[_3_]
external usenet poster
 
Posts: 3
Default Automate attachment selection

Hello,

This is the code I was referring to:

Quote:
Sub InsertFile()
' requires reference to Microsoft Outlook library
Dim objOL As Outlook.Application
Dim objInsp As Outlook.Inspector
Dim objMail As Outlook.MailItem
On Error Resume Next
Set objOL = GetObject(, "Outlook.Application")
Set objInsp = objOL.ActiveInspector
Set objMail = objInsp.CurrentItem
objMail.Attachments.Add "C:\data\myfile.txt"
Set objMail = Nothing
Set objInsp = Nothing
Set objOL = Nothing
End Sub



And the Excel file does not change. And it's location (in C drive) does not change either.
Ads
 

Credit Counseling - Vegas Hotel - Loans - Credit Cards - Credit Report