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
   .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, "
Who is Participating?
tdlewisConnect With a Mentor Commented:
Excel makes it difficult to select a cell that contains a hyperlink. (If you pay attention to the cursor, when it's a hand, the link will open and when it's a plus, the cell will be selected.)

If the mailto hyperlink contains a semicolon then my email program will send to two recipients. For example: ";". There is probably some upper limit to the number of characters that can appear in the hyperlink.

Just out of curiosity, if there are email addresses in cells H4:H10, what do you want to happen when the user clicks on cell H8 (send to all 7 addresses or just the one in H8)?
Based on some quick testing, it appears that the upper limit is 1026 characters following "mailto:"
NormaPosyPhysicistAuthor Commented:
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.
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

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.
NormaPosyPhysicistAuthor Commented:
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.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.