Link to home
Start Free TrialLog in
Avatar of Norma Posy
Norma PosyFlag for United States of America

asked on

Grouping a sequence of live email addresses from Excel

My VB6 application generates an Excel spreadsheet.
Column H contains live email addresses, starting at row 5.
Here is the code:

sCol = "H"
For iI = 1 To iMaxItems
   sRow = CStr(iI + 4)
   sRange = sCol & sRow
   .Range(sRange).Select
   .ActiveSheet.Hyperlinks.Add Anchor:=.Selection, _
      Address:="mailto:" & .Selection.Value
Next iI

Open in new window


This works all right, for each individual email address.
But the user would like to select a group of them from the spreadsheet for a bulk emailing. (Most likely, the entire column H from Row 4 to the last item.)

But when I click the top one, I go directly to the email utility, without having a chance to somehow select all of them.

Any suggestions??

The only thing I can think of would be for the VB6 application to toss out a text file containing one long string of concatenated email addresses. Then the user would have to copy and paste into the "To" line of his email utility.

It would be slicker to do this directly from the spreadsheet.

By the way, with this in mind, the email address entries actually have a <comma+space> appended: "xxx@yyy, "
ASKER CERTIFIED SOLUTION
Avatar of tdlewis
tdlewis
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Based on some quick testing, it appears that the upper limit is 1026 characters following "mailto:"
Avatar of Norma Posy

ASKER

I will have to sit down with the user, then get back to you.

Database has over 200 records. One element of each record is a five-character "attribute" string. There are a variety of subsets filtered on those five attributes, from which an abbreviated spreadsheet is generated.

I have to find out if the user, having done that, intends to bulk email to all the filter survivors.
If that's the case, you will need to read the addresses after the filter has been applied and then pass them to the email application.
I think I figured it out. In the spreadsheet: Click on the cell immediately above the column containing the email addresses. Shift-click on the cell immediately below. Copy, and paste to the "To" email message line.

Point 1: This assumes the top and bottom cells clicked on are empty. Otherwise the copied To line will have to be edited.

Point 2: This isn't using the cell contents as "live" email addresses.

Point 3: But that's ok. Each individual cell is still "live".

Point 4: I believe this will satisfy the user. He can "live click" to email to one specific address, or he can bulk mail to all of them.

Point 5: If he wants to email to a subset of the filter survivors, he should tell me that, and I will provide a finer filter.

I will have one more sit-down with him, then I anticipate that this question can be closed.

Meanwhile - - Thank You for your help.
You're welcome. Glad you got it figured out. The most interesting part of responding to this question was figuring out the upper limit for the string following mailto.