A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Emailing from Access



 
 
Thread Tools Display Modes
  #1  
Old October 13th, 2004, 11:37 AM
Alex
external usenet poster
 
Posts: n/a
Default Emailing from Access

Not sure if this is correct forum

Am looking to be able to set up routine to allow me to send emails from data
held in Access Query - either through outlook or some other third party
program.

Anyone anyu ideas as to best way to set this up please

Thanks

Alex


  #2  
Old October 21st, 2004, 12:44 AM
Daniel
external usenet poster
 
Posts: n/a
Default

First off, and I'm not trying to be rude, just trying to point you in the
proper location, you really should post this type of message in the
programming newsgroup (...access.modulesdaovba).

Besides that, you want to use a routine like:

**********************
Function SendMessage(Dwg As String, Issue As String, Lead As String)
Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Dim objOutlookAttach As Outlook.Attachment

' Create the Outlook session.
Set objOutlook = CreateObject("Outlook.Application")

' Create the message.
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)

With objOutlookMsg
' Add the To recipient(s) to the message.
Set objOutlookRecip = )
'Check
objOutlookRecip.Type = olTo

' Add the CC recipient(s) to the message.
'Set objOutlookRecip = .Recipients.Add("Andrew Fuller")
'objOutlookRecip.Type = olCC

' Set the Subject, Body, and Importance of the message.
.Subject = "Some Subject Line You Want To Appear"
.Body = "Actual Content of the E-mail"
'.Importance = olImportanceHigh 'High importance

' Add attachments to the message.
'If Not IsMissing(AttachmentPath) Then
' Set objOutlookAttach = .Attachments.Add(AttachmentPath)
'End If

' Resolve each Recipient's name.
'For Each objOutlookRecip In .Recipients
' objOutlookRecip.Resolve
' If Not objOutlookRecip.Resolve Then
' objOutlookMsg.Display
'End If
'Next
.Send

End With
Set objOutlookMsg = Nothing
Set objOutlook = Nothing
End Function
***************************

This should at least get you started! Hope it helps,

Daniel

"Alex" wrote in message
...
Not sure if this is correct forum

Am looking to be able to set up routine to allow me to send emails from

data
held in Access Query - either through outlook or some other third party
program.

Anyone anyu ideas as to best way to set this up please

Thanks

Alex




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Conversion Problems Katherine R New Users 11 December 19th, 2004 12:38 AM
Data from Excel to Access Database Design 2 August 20th, 2004 12:53 PM
Access user profile Michael Breitsameter General Discussion 7 July 23rd, 2004 07:47 AM
Useless Access 2003 tired, angry, sucidial and bored General Discussion 10 July 21st, 2004 11:52 PM


All times are GMT +1. The time now is 09:01 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.