Click to See Complete Forum and Search --> : How to Receive Email using Ms-Access and Outlook


ttamilvanan81
April 11th, 2007, 07:49 AM
Hai, Am Tamilvanan. Am a New to Access.

In my Access Application i need to Send and Receive Email with Attachment. But i have the Problem in Attachment.

I need the attachment function is work as follows. Need one Browse Button. If we click that Browse Button, the file open Dialog Box will be open, then we select a particular file and click open.

Then the selected file path will be stored into a textbox. I know the Common Dialog Control was do this. But when i go to my Access Form in Design view and try to put the Common Dialog Control the following Error Message will be raised.

you don't have the license required to use this ActiveX control.
You tried to open a form containing an OLE object or an ActiveX control or you tried to create an ActiveX control. To obtain the appropriate license, contact the company that provides the licensed OLE object or ActiveX control.

Then i try to Register the Control, like comcat.dll, comctl32.dll, comdlg32.dll, COMDLG32.OCX.

The COMDLG32.OCX only was Registered Successfully. But i have the another problem.

The error is:


c:\windows\system32\comctl32.dll was loaded, but the DllRegisterServer entry point was not found.

This file can not be registered.

So, still i am stuck. Pls help me. How to put the Common Dialog Control into my Ms-Access Form.


Am using the Code for Send Email as follows:
Private Sub Command20_Click()

Dim mess_body As String
Dim appOutLook As Outlook.Application
Dim MailOutLook As Outlook.MailItem
Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)

Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)
With MailOutLook
.BodyFormat = olFormatRichText
.to = Me.Email_Address
.cc = Me.Cc_Address
.bcc = Me.Bcc_Address
.Subject = Me.Mess_Subject
.HTMLBody = Me.mess_text
If Left(Me.Mail_Attachment_Path, 1) <> "<" Then
.Attachments.Add (Me.Mail_Attachment_Path)
End If
'.DeleteAfterSubmit = True 'This would let Outlook send th note without storing it in your sent bin
.send
End With
'MsgBox MailOutLook.Body
Exit Sub
email_error:
MsgBox "An error was encountered." & vbCrLf & "The error message is: " & Err.Description
Resume Error_out
Error_out:
End Sub


and also i need to do the another Task, Receive Email using Ms-Access and Outlook.

The Receive Email will be work as.

On the receiving end(Outlook), the user receives the email at the Outlook. When they opens the Email in Outlook Inbox, the message box should have a button called "Save to Access".

When this button is pressed, a dialog box should pop up where the user can choose a contact name and a job name and click on SAVE

Here contact name and job name are in the access table fields. We go to select any one contact and any one job for the particular Email. Then the Email details are stored into a Access table.

Am Trying to solve this using many of Forum's. But still i can't. So if u know how to solve the above problems for Attachment and also how to Receive Email using Ms-Access and Outlook, Please intimate me.

I am waiting for anyone Reply.



Thanks & Regards

Tamilvanan