from access to outlook 2

  • Thread starter יריב החביב
  • Start date
×

יריב החביב

Hello,

In order to send more then one file in mail

i got this code in previous question, here.

my question is how can i see the mail before sending it ?
and way i get error message 'user defined-type not defind' ?
(when i cancel the Dim statement, it work well)

Private Sub Command0_Click()
'Arvin Meyer 03/12/1999
'Updated 7/21/2001

Dim objOutlook As Outlook.Application
Dim objEmail As Outlook.MailItem
Set objOutlook = CreateObject("Outlook.application")
Set objEmail = objOutlook.CreateItem(olMailItem)
With objEmail
.To = "(e-mail address removed)"
.Subject = "Look at this sample attachment"
.body = "The body doesn't matter, just the attachment"
.Attachments.Add "C:\Test.htm"
'.attachments.Add "c:\Path\to\the\next\file.txt"
.Send
'.ReadReceiptRequested
End With
Exit_Here:
Set objOutlook = Nothing
Exit Sub

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top