Dave Eyley
Registered User.
- Local time
- Today, 07:58
- Joined
- Sep 5, 2002
- Messages
- 254
Hi all,
I'm using a piece of code to open a dialog window to find a file and then add it to field on a form where the file will be attached to an email and sent out automatically.
The code -
The problem is the code stops with an error at the point in red. If, however I type the path as say, "C:\users\George\documents\file.doc", it works OK.
It doesn't seem to like the reference to Me!BulkAttachment
Can anyone suggest a solution?
Dave
I'm using a piece of code to open a dialog window to find a file and then add it to field on a form where the file will be attached to an email and sent out automatically.
The code -
Code:
If Not IsNothing(MySet![email]) Then
Mailcount = Mailcount + 1
Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)
With MailOutLook
'set the recipient list
.To = MySet![email]
'set the subject
.Subject = Me.BulkSubject
'set the body text
.Body = Me!BulkBody
'add the attachment
If Me!AttachmentFlag = True Then
[COLOR="Red"].attachments.Add Me!BulkAttachment[/COLOR]
End If
'send or display the email
If Me!OutlookOpt = 2 Then
.Send
Else
.Display
End If
End With
'get rid of our object references
Set appOutLook = Nothing
Set MailOutLook = Nothing
End If
The problem is the code stops with an error at the point in red. If, however I type the path as say, "C:\users\George\documents\file.doc", it works OK.
It doesn't seem to like the reference to Me!BulkAttachment
Can anyone suggest a solution?
Dave
Last edited: