Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Email Attachments In Access 97

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Does anyone know if it is possible to send a file on a file server to an email?

this will all be automatic within the email code.
I have it all working except the attaching of the file. I have tried sendobject etc

the problem is I need to send users their passwords, this has to be atleast partly secure. So I will be sending their passwords in a password protected zip file. the problem is attaching this Zip file to an email automatically.

can anyone help?

thanks

 
Try the code listed below. However let me know if you can figure out the problem I am also having.

I can use the following code to create an email message in Outlook 2000 and attach a file. However, the file attaches at the beginning (top left corner) of the email. Any suggestions on how to get the attachment to attach at the end of the email.

Private Sub Command0_Click()
Dim stpath As String
Dim appoutlook As Outlook.Application
Dim mailoutlook As Outlook.MailItem
Set appoutlook = CreateObject("outlook.application")
Set mailoutlook = appoutlook.CreateItem(olMailItem)
stpath = "C:\Documents and Settings\Owner\Desktop\abc.pdf"
With mailoutlook
.To = "email@emailaddress.com"
.Subject = "Test"
.Body = "Test Attachment"
.Attachments.Add stpath
.Display
End With
End Sub

.Display lets you preview the email message before its sent. When previewing the email I can goto Format on the toolbar and change the Format to "Plain Text" which then causes the email to attach in a new window pane a the bottom of the email. Is it possible to do this from code?

Thanks

DH
 
DH
Try to force in the vb enter character(vbCrLf) at the end of your email body. This will make the atatchment appear to be at the bottom.
eg.
.Body = "Attach Please find Journals for Today..." & vbCrLf

Thanks
Tim
 
I was just searching around and I saw this post... When I try to use the code you provided I get an error on Dim appoutlook As Outlook.Application

Is there some special update I need for Access 97 to recognize the "Outlook" object? I tried installing the Data Access stuff in the Value Pack folder, but that didn't help either.

Thanks for any help you can give!
 
Dear DH,


I try the example of codes given by you, but somehow it can send the email but not the attachment... the receipent receive the email without the attachment... any ideas?? Please help...

Thanks in advance....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top