> This may have already been asked. I have a column
> that has an email address in each row. How can I create
> an email message by clicking on a header that will
> include all emails in the individual rows?
Hi. I wish to send a single email to any email address in
a specific column. Not a selection. Right now, there are
249 rows in that column. The header I mentioned is
actually a column heading,sorry.
I have tried to append all emails in that column into a
string variable with a macro. When the Outlook email
message appears, I only have about 5% of the emails
listed in the TO field. Excel seems to only allow a
certain number of characters in a string, right?
I have also tried to load all emails into an array that
increments when the length of the string is > 230. But
that's where I'm stuck. I loop through the array and
perform a FollowHyperlink. I get all emails to appear in
the TO field of the email, but I get multiple windows.
Help?
>-----Original Message-----
>> This may have already been asked. I have a column
[quoted text clipped - 12 lines]
>
>.
Bill Manville - 04 Dec 2003 01:21 GMT
> I wish to send a single email to any email address in
> a specific column. Not a selection.
Do you mean "I wish to send a single email to ALL the email addresses
in a specific column"?
> The header I mentioned is actually a column heading,sorry
Do you mean the first cell in the column or the button-like thing at
the top of the column that contains the column letter?
> Excel seems to only allow a certain number of characters in a string,
right?
Rather a lot actually - about 32,000
However, the interface you are using to Outlook may restrict the number
of characters passed across.
I don't use Outlook, but you could try using the following code
(untested):
Sub DoAnEMail(Recipients As Range)
Dim oNS As Object
Dim oF As Object
Dim oI As Object
Dim oMail As Object
Dim R as Range
On Error Resume Next
Set oOutl = GetObject(, "Outlook.Application")
If Err <> 0 Then
Err.Clear
Set oOutl = CreateObject("Outlook.Application")
If Err <> 0 Then
MsgBox "I cannot send an email - Outlook is not available on this
machine"
Exit Sub
End If
End If
On Error GoTo locErr
Set oNS = oOutl.GetNamespace("MAPI")
oNS.Logon
Set oMail = oOutl.CreateItem(0) ' olMailItem
For Each R In Recipients.Cells
oMail.Recipients.Add R.Value
Next
Set oI = oMail.GetInspector
oI.Display
End Sub
Call it by, for example
DoAnEMail Range(Cells(1,ActiveCell.Column), _
Cells(1,ActiveCell.Column).End(xlDown))
Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - respond to newsgroup
David McRitchie - 07 Dec 2003 18:08 GMT
are you the same poster as Ed ? It is very difficult to follow
conversations posted through communities that do not thread
properly, don't have unique names like a first and last name,
and have anonymous@ thrown in as an
email address, and perhaps inconsistent names entered
from one post to another.
A column width can only be 255 characters wide. Try turning on
cell wrapping. Format, cells, alignment, [x] wrap.
See specification limits in my other reply in this thread.
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
> Hi. I wish to send a single email to any email address in
> a specific column. Not a selection. Right now, there are
[quoted text clipped - 31 lines]
> >
> >.