Dougalsworld
Paul
- Local time
- Yesterday, 22:17
- Joined
- Jul 29, 2005
- Messages
- 62
Hi folks
I have a database that arranges training sessions. It sends out the meeting requests automatically.
What I'm trying to do is add ann attachment to the mail...now I know how to do this by manually adding the file location, problem is the attachement is a different file for every course.
So I have a field set up that references the file location, but I can't seem to use this.
e.g.
Field [txtTM] = "C:\file.zip"
However if I use the code
.Attachment.Add = [txtTM]
I get an erro message...however if I use
.Attachment.Add = "C:\file.zip"
Then it works, unfortunately the second option does not allow for the unique files
Does anyone have any ideas? The full code is below:
' Add a new meeting.
Else
Dim outobj As Outlook.Application
Dim outappt As Outlook.AppointmentItem
Dim stDocName As String
Set outobj = CreateObject("outlook.Application")
Set outappt = outobj.CreateItem(olAppointmentItem)
With outappt
.Start = [txtCourseDate] & " 09:00"
.Duration = [txtDuration]
.Subject = [txtSubject]
.MeetingStatus = olMeeting
.Attachments.Add = "[txtTM]"
Set myRequiredAttendee = .Recipients.Add(Me!cboMail)
myRequiredAttendee.Type = olRequired
If Not IsNull("test") Then .Body = [txtBody]
If Not IsNull("BDU") Then .Location = _
"BDU"
.Recipients.ResolveAll
.Display
.Send
.Save
End With
End If
' Release the Outlook object variable.
Set outobj = Nothing
Many Thanks
Paul
I have a database that arranges training sessions. It sends out the meeting requests automatically.
What I'm trying to do is add ann attachment to the mail...now I know how to do this by manually adding the file location, problem is the attachement is a different file for every course.
So I have a field set up that references the file location, but I can't seem to use this.
e.g.
Field [txtTM] = "C:\file.zip"
However if I use the code
.Attachment.Add = [txtTM]
I get an erro message...however if I use
.Attachment.Add = "C:\file.zip"
Then it works, unfortunately the second option does not allow for the unique files
Does anyone have any ideas? The full code is below:
' Add a new meeting.
Else
Dim outobj As Outlook.Application
Dim outappt As Outlook.AppointmentItem
Dim stDocName As String
Set outobj = CreateObject("outlook.Application")
Set outappt = outobj.CreateItem(olAppointmentItem)
With outappt
.Start = [txtCourseDate] & " 09:00"
.Duration = [txtDuration]
.Subject = [txtSubject]
.MeetingStatus = olMeeting
.Attachments.Add = "[txtTM]"
Set myRequiredAttendee = .Recipients.Add(Me!cboMail)
myRequiredAttendee.Type = olRequired
If Not IsNull("test") Then .Body = [txtBody]
If Not IsNull("BDU") Then .Location = _
"BDU"
.Recipients.ResolveAll
.Display
.Send
.Save
End With
End If
' Release the Outlook object variable.
Set outobj = Nothing
Many Thanks
Paul