create emails with attachment

David b

Registered User.
Local time
Today, 15:14
Joined
Mar 2, 2003
Messages
102
I have some code which creates emails based on an address list . I would like a msg box saying do you want to include an attachment
with these emails? yes no. If yes open a browse box to allow the file to be selected.
Any thoughts on how to do this ?
David B
Hexham UK
 
Put a common dialog control on your form and try this.
Code:
Dim Response

Response = MsgBox("Do you want to add an attachment to the email?,vbYesNo,"Message Title")

If Response = vbYes Then
 Me.ActiveXCtl48.InitDir = "C:\"
 Me.ActiveXCtl48.Filter = "*.doc|*.doc"
 Me.ActiveXCtl48.ShowOpen
 If Me.ActiveXCtl48.FileName <> "" Then
   Me.Location = Me.ActiveXCtl48.FileName
Else Exit Sub
End If
You will need to replace the 48 in ActiveXCtl48 to the number assigned to your control.
Also change the Location field to your field name
 

Users who are viewing this thread

Back
Top Bottom