473,408 Members | 1,840 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Outlook Distribution List not possible in SendEmail Function

44
Hi,
I have a module, which contains a SendEmail Function. In the MailSendItem I want to enter an Outlook Distribution List as the ".To". But it's not going to work. I can only enter complete email adresses like istea@yahoo.com.au.
Does anybody has an idea?
Many thanks in advance.
Sep 22 '06 #1
5 4534
PEB
1,418 Expert 1GB
Hi,

How have you managed to activate Outlook from Access...

I've always used docmd.sendobject

:)
Sep 22 '06 #2
isetea
44
Hi,

I used the following code within a module. This was necessary, because sending this email is only one part of a process and I set all steps into a macro and create a command button to run the full process at once (new requirement).

Before this requirement came up, I send the email through a command button. There I was able to enter a distribution list in the code. But this changed and I can't use it any more.

Function SendEmail()
Dim OL As Object
Dim MailSendItem As Object
On Error GoTo Err_SendEmail
'Create an instance of Outlook
Set OL = CreateObject("Outlook.Application")
'Create a new mail Item
Set MailSendItem = OL.CreateItem(olMailItem)
With MailSendItem
.Subject = "Report"
.To = "email@email.com"
.body = "The attached..."

.Attachments.Add "C:\Temp\report.xls"
.NoAging = False 'Ensures a response is returned to you if not opened
.Send
Set OL = Nothing
End With
Exit_SendEmail:
Err.Clear
On Error Resume Next
Exit Function
Err_SendEmail:
MsgBox "Error while executing SendEmail routine. " & Err.Description, vbCritical
Resume Exit_SendEmail:
End Function

Does this help?



Hi,

How have you managed to activate Outlook from Access...

I've always used docmd.sendobject

:)
Sep 24 '06 #3
PEB
1,418 Expert 1GB
If you don't enter the complete adress is there any error that appears?

It seems that the field is string... and accepts every string!

Logically if you type the same thing in Outlook the result have to be the same!

Maybe the only thing is that there is not a send message?

You type which part of the adress?

:)

Best regards!
Sep 25 '06 #4
isetea
44
Hi,
it's a bit cryptical. After trying it today again, it is working as expected. I don't know, maybe the database needed the weekend-break (or me)!! :) :)

But thanks...

If you don't enter the complete adress is there any error that appears?

It seems that the field is string... and accepts every string!

Logically if you type the same thing in Outlook the result have to be the same!

Maybe the only thing is that there is not a send message?

You type which part of the adress?

:)

Best regards!
Sep 25 '06 #5
PEB
1,418 Expert 1GB
It's arrives!

In the computer world every thing matter!

Take care my frien!

:)
Sep 25 '06 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: michiel | last post by:
Does anybody know how to create a email distrubution list in ms Access thanks
1
by: Dave | last post by:
Using Outlook2k on Win2k/XP, is there a way to produce the addresses that make up an Outlook Distribution List?
1
by: M Stery | last post by:
I'm confused about the best way to accomplish this. Master Access db holds email addresses for a variety of job titles. Personnel holding those job titles and email addresses change all the time in...
0
by: Jason James | last post by:
Hi all, does anyone have any suggestions as to the steps involved in creating a DL using VB.Net. I have some Outlook automation experience but I'm not sure what the objects are that I should...
1
by: raghuveer.v | last post by:
Hi, We have a distribution list in our company's outlook address book (exchange server) that has the alias "domain.division" People with the rights to send broadcast mails use this alias in...
0
by: Ratnesh Raval | last post by:
hi all, i am writing a application that accesses outlook using Microsoft.Office.Interop.Outlook.Application i need to extract all contacts from contact folder. but i dont want the...
3
by: chiinook | last post by:
I have built a fairly simple database to manage contact information for about 300 clients. Some of these have requested that I send them our publications by email rather than post. I have created a...
0
by: gowthamkg | last post by:
hi, I want read contacts in Particular Distribution List in outlook 2007 using C#(visual studio 2008)...i'm able to create to new distribution list and add members..How to retrieve them...
0
by: timr30017 | last post by:
For days now I've been trying to create a Distribution List in Outlook from my VB.net app. I can create one but I cannot put any members in it because there seems to be no way to define and create a...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.