EliseFreedman
Programmer
Hi
I am currently getting to grips with our new email system. I use the system to send various files on a daily basis and I am trying to write a program in access to automatically create the emails
The program works as long as I know the filename. However one of the files to be send has an extension which changes each day. for example
upsales.525 one day
upsales.526 the next day
The following is the code that I am using to send the file where the name is the same each day.
With .Attachments.Add("C:\sales info data\upsales.525"
.DisplayName = "upsales"
End With
Ideally I would like to set it to attach any file starting with upsales regardless of the extension.
I have tried upsales.* and I have also tried getting the exact filename using Dir, putting the filename into a string and then sending that as shown below
Dim sFile As String
sFile = Dir("c:\sales info Data\upsales.*"
If sFile <> "" then
debug.print sfile
Else
MsgBox "Can't Find File"
End If
With .Attachments.Add("sfile"
.DisplayName = "upsales"
End With
However, both methods have failed. I get a message telling me that the system cant find the file specified
Does Anyone have any other ideas
I am currently getting to grips with our new email system. I use the system to send various files on a daily basis and I am trying to write a program in access to automatically create the emails
The program works as long as I know the filename. However one of the files to be send has an extension which changes each day. for example
upsales.525 one day
upsales.526 the next day
The following is the code that I am using to send the file where the name is the same each day.
With .Attachments.Add("C:\sales info data\upsales.525"
.DisplayName = "upsales"
End With
Ideally I would like to set it to attach any file starting with upsales regardless of the extension.
I have tried upsales.* and I have also tried getting the exact filename using Dir, putting the filename into a string and then sending that as shown below
Dim sFile As String
sFile = Dir("c:\sales info Data\upsales.*"
If sFile <> "" then
debug.print sfile
Else
MsgBox "Can't Find File"
End If
With .Attachments.Add("sfile"
.DisplayName = "upsales"
End With
However, both methods have failed. I get a message telling me that the system cant find the file specified
Does Anyone have any other ideas