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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open Outlook 1

Status
Not open for further replies.

ninash

Technical User
Jul 6, 2001
163
GB
Hi All,

I have a field on a form that contains an email address.
How can I make outlook open to allow my users write an email using the address in that field if they click it.

Alternatively The form that the email address is on generates a report in Microsoft Word. As I have the path and file name is it possible to again open outlook and use the address as the send location but also attach the file.

Both of the above are required in different locations but the second one would be the most useful.

Thanks in advance for any help you can offer.

Tony
 
Hi

You can send an EMail using DoCmd.SendObject

If you just want an EMail with no attachment, then use:

DoCmd.SendObject acSendNoObject,...etc see help for rest of syntax

If you want to send an EMail with a report as an Attachment, then use:

DoCmd.SendObject acSendReport,... etc see help for rest of Syntax

To send your word report you will need to create an Outlook object and manipulate it from within Access, this is a bit more lengthy, give me a few mins and I will post more details

Regards

Ken Reay
 
Hi Again

here is teh Outlook info

Dim olApp As Outlook.Application
Dim olNS As Outlook.NameSpace
Dim olMail As Outlook.MailItem
'
' Create an Outlook instance
Set olApp = GetObject("Outlook.Application")
' Log on
Set olNS = olApp.GetNamespace("MAPI")
olNS.Logon
' Create Message
Set olMail = olApp.CreateItem(olMailItem)
olMail.To = strEMail
olMail.CC = Nz(strCC, "")
olMail.Subject = strSubject
olMail.Body = strMessage
'
olMail.Attachments.Add strAttachment <- strAttachement to contain file name of teh Attachment
'
olMail.Send
UpdateLog
olNS.Logoff
Set olNS = Nothing
Set olMail = Nothing
 
Thanks Ken
You are a true friend to total strangers

Hope the star helps in showing how much you have helped me
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top