Group E-mailing

B

bgarey

I have a data base of entries with one field set up as E-mail addresses.
How can I tell the computer to collect all these addresses as a group and
send out one e-mail to the whole group?
 
W

Wayne-I-M

Use a multi select list box

You will need to download ClickYes (it's free) if you're using outlook to
get round the secutrity warning
 
W

Wayne-I-M

Or


Say you have a list box with
ID, 1stName, EmailAddress
Your list box is called MyListBox

You have a report that you can filter via a query and this report is call
MyReport

You have a form (MyForm) with a button (MyButton)

You have a text box on your form (MyTextBox)
You have another text box on your form (MyOtherTextBox)

You want to send out lots of MyReports to all the people in MyListBox

You want to personalise the reports

You want to personalize the title of the e mail
You want to add some text in the detail of the e mail

You want to send your admin office an email saying your so good at your job
you have sent all the reports




Public Sub MyButton _Click()

Dim varItem As Variant

'select all items on list box'
With Me. MyListBox
For lngX = Abs(.ColumnHeads) To (.ListCount - 1)
.Selected(lngX) = True
Next
End With

For Each varItem In Me. MyListBox.ItemsSelected

Me. MyTextBox = MyListBox.Column(1, varItem)
Me. MyOtherTextBox = MyListBox.Column(0, varItem)

'Copy report and rename it'
DoCmd.CopyObject , "Sale and Stuff" & " " & Format(Date, "short date") & "
for " & MyListBox.Column(1, varItem), acReport, "MyReport"

'set value to filter the report'
Me.MyOtherTextBox = Me.MyListBox.Column(0, varItem)

'open the new report'
DoCmd.OpenReport "Sale and Stuff" & " " & Format(Date, "short date") & " for
" & MyListBox.Column(2, varItem), acViewPreview, "",
"[ID]=[Forms]![MyForm]![MyOtherTextBox]", acHidden

'send the new report everyone'
DoCmd.SendObject acReport, "Sale and Stuff" & " " & Format(Date, "short
date") & " for " & MyListBox.Column(1, varItem) , "RichTextFormat(*.rtf)",
MyListBox (1, varItem), MyListBox.Column(2, varItem), "", "", False, ""


'close the new report'
DoCmd.Close acReport, "Sale and Stuff" & " " & Format(Date, "short date") &
" for " & MyListBox.Column(1, varItem),

'Deletes the new report - but leave the original template in place'
DoCmd.DeleteObject acReport, "Sale and Stuff" & " " & Format(Date, "short
date") & " for " & MyListBox.Column(1, varItem),

'go to next item on the list and do it again'
Next varItem

'send admin a note to say the reports have been done'
DoCmd.SendObject acSendNoObject, , , "Some E Mail (e-mail address removed) ", "",
"", "To Admin from Me ", "God I’m so good I have done the reports already.
The reports all went at " & Format(Now, "dd mmmm yyyy hh:nn AM/PM"), False, ""

'Open Outlook so the mails will send - you may need to change the path'
Call Shell("C:\Program Files\Microsoft Office\OFFICE11\OUTLOOK.EXE")

End Sub



I have NOT checked this but it hould be OK - or something like that :)
 
B

bgarey

I don't know programming. Is there away to do this with macros, or do I need
to learn Visual basic?

Wayne-I-M said:
Or


Say you have a list box with
ID, 1stName, EmailAddress
Your list box is called MyListBox

You have a report that you can filter via a query and this report is call
MyReport

You have a form (MyForm) with a button (MyButton)

You have a text box on your form (MyTextBox)
You have another text box on your form (MyOtherTextBox)

You want to send out lots of MyReports to all the people in MyListBox

You want to personalise the reports

You want to personalize the title of the e mail
You want to add some text in the detail of the e mail

You want to send your admin office an email saying your so good at your job
you have sent all the reports




Public Sub MyButton _Click()

Dim varItem As Variant

'select all items on list box'
With Me. MyListBox
For lngX = Abs(.ColumnHeads) To (.ListCount - 1)
.Selected(lngX) = True
Next
End With

For Each varItem In Me. MyListBox.ItemsSelected

Me. MyTextBox = MyListBox.Column(1, varItem)
Me. MyOtherTextBox = MyListBox.Column(0, varItem)

'Copy report and rename it'
DoCmd.CopyObject , "Sale and Stuff" & " " & Format(Date, "short date") & "
for " & MyListBox.Column(1, varItem), acReport, "MyReport"

'set value to filter the report'
Me.MyOtherTextBox = Me.MyListBox.Column(0, varItem)

'open the new report'
DoCmd.OpenReport "Sale and Stuff" & " " & Format(Date, "short date") & " for
" & MyListBox.Column(2, varItem), acViewPreview, "",
"[ID]=[Forms]![MyForm]![MyOtherTextBox]", acHidden

'send the new report everyone'
DoCmd.SendObject acReport, "Sale and Stuff" & " " & Format(Date, "short
date") & " for " & MyListBox.Column(1, varItem) , "RichTextFormat(*.rtf)",
MyListBox (1, varItem), MyListBox.Column(2, varItem), "", "", False, ""


'close the new report'
DoCmd.Close acReport, "Sale and Stuff" & " " & Format(Date, "short date") &
" for " & MyListBox.Column(1, varItem),

'Deletes the new report - but leave the original template in place'
DoCmd.DeleteObject acReport, "Sale and Stuff" & " " & Format(Date, "short
date") & " for " & MyListBox.Column(1, varItem),

'go to next item on the list and do it again'
Next varItem

'send admin a note to say the reports have been done'
DoCmd.SendObject acSendNoObject, , , "Some E Mail (e-mail address removed) ", "",
"", "To Admin from Me ", "God I’m so good I have done the reports already.
The reports all went at " & Format(Now, "dd mmmm yyyy hh:nn AM/PM"), False, ""

'Open Outlook so the mails will send - you may need to change the path'
Call Shell("C:\Program Files\Microsoft Office\OFFICE11\OUTLOOK.EXE")

End Sub



I have NOT checked this but it hould be OK - or something like that :)

--
Wayne
Trentino, Italia.



bgarey said:
I have a data base of entries with one field set up as E-mail addresses.
How can I tell the computer to collect all these addresses as a group and
send out one e-mail to the whole group?
 
W

Wayne-I-M

Hi

Not sure about macros as don't use many of them (a few autoexec's and some
that I created so admin management can alter them).

I don't think your can do this with macros but I may worng about this this.

The code I sent is basically a list box box that you can send a report to
lots of people with the personalised sections added - as they always make
reports look better ie. Hi John here is you report. This is bette than just
sending a standard report.

But if you wanted to cut out all the "stuff" it's quite simple to have a
list box that you send out a standard report to (all the people in the list
or just the people that you select from the list).

If you post the this information then many people on this formum would be
able to give you the code (cut and paste) and a step by step method.

We would need
The full name of the report
The name of the listbox
Details of the listbox - what is in each column. I would suggest you create
a very simple query showing just the primary field (normally an ID
autonumber) from your table and the e mail address.

You would be better to filter the query to show only the people you want to
send the report to - to make it simpler to start with.

Thats it, thats all you need.
A list box showing who you want to send the report to and the report itself.

Of course access can make the reports much better but if you're happy just
to send out a standard report then post back with the details


--
Wayne
Trentino, Italia.



bgarey said:
I don't know programming. Is there away to do this with macros, or do I need
to learn Visual basic?

Wayne-I-M said:
Or


Say you have a list box with
ID, 1stName, EmailAddress
Your list box is called MyListBox

You have a report that you can filter via a query and this report is call
MyReport

You have a form (MyForm) with a button (MyButton)

You have a text box on your form (MyTextBox)
You have another text box on your form (MyOtherTextBox)

You want to send out lots of MyReports to all the people in MyListBox

You want to personalise the reports

You want to personalize the title of the e mail
You want to add some text in the detail of the e mail

You want to send your admin office an email saying your so good at your job
you have sent all the reports




Public Sub MyButton _Click()

Dim varItem As Variant

'select all items on list box'
With Me. MyListBox
For lngX = Abs(.ColumnHeads) To (.ListCount - 1)
.Selected(lngX) = True
Next
End With

For Each varItem In Me. MyListBox.ItemsSelected

Me. MyTextBox = MyListBox.Column(1, varItem)
Me. MyOtherTextBox = MyListBox.Column(0, varItem)

'Copy report and rename it'
DoCmd.CopyObject , "Sale and Stuff" & " " & Format(Date, "short date") & "
for " & MyListBox.Column(1, varItem), acReport, "MyReport"

'set value to filter the report'
Me.MyOtherTextBox = Me.MyListBox.Column(0, varItem)

'open the new report'
DoCmd.OpenReport "Sale and Stuff" & " " & Format(Date, "short date") & " for
" & MyListBox.Column(2, varItem), acViewPreview, "",
"[ID]=[Forms]![MyForm]![MyOtherTextBox]", acHidden

'send the new report everyone'
DoCmd.SendObject acReport, "Sale and Stuff" & " " & Format(Date, "short
date") & " for " & MyListBox.Column(1, varItem) , "RichTextFormat(*.rtf)",
MyListBox (1, varItem), MyListBox.Column(2, varItem), "", "", False, ""


'close the new report'
DoCmd.Close acReport, "Sale and Stuff" & " " & Format(Date, "short date") &
" for " & MyListBox.Column(1, varItem),

'Deletes the new report - but leave the original template in place'
DoCmd.DeleteObject acReport, "Sale and Stuff" & " " & Format(Date, "short
date") & " for " & MyListBox.Column(1, varItem),

'go to next item on the list and do it again'
Next varItem

'send admin a note to say the reports have been done'
DoCmd.SendObject acSendNoObject, , , "Some E Mail (e-mail address removed) ", "",
"", "To Admin from Me ", "God I’m so good I have done the reports already.
The reports all went at " & Format(Now, "dd mmmm yyyy hh:nn AM/PM"), False, ""

'Open Outlook so the mails will send - you may need to change the path'
Call Shell("C:\Program Files\Microsoft Office\OFFICE11\OUTLOOK.EXE")

End Sub



I have NOT checked this but it hould be OK - or something like that :)

--
Wayne
Trentino, Italia.



bgarey said:
I have a data base of entries with one field set up as E-mail addresses.
How can I tell the computer to collect all these addresses as a group and
send out one e-mail to the whole group?
 
H

Howard Burgman

bgarey said:
I have a data base of entries with one field set up as E-mail addresses.
How can I tell the computer to collect all these addresses as a group and
send out one e-mail to the whole group?
 

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