E-Mail Subject text from SendMessage function

JCShort

Registered User.
Local time
Today, 08:04
Joined
Aug 29, 2008
Messages
35
I'm using the standard Microsoft "SendMessage" function to open Outlook, pre-fill 'To:', 'Cc:', Subject, & Body fields, along with attachment of a report. It works wonderfully well! Except, I've just been asked from up on high to adjust the subject content.

I have:
Code:
             ' Set the Subject, Body, and Importance of the message.
             .Subject = "Cancellation for " & Forms![frmpoldd]![Client]

Forms![frmpoldd]![Client] is simply the client name. Here's where it gets tricky. I need to add any applicable location numbers for the client to the subject field. However, I'm using a subform for all of the location input because a client can might only have 1 location or they may have many.

I'm going to make a case to upper mgmt that the subject line is too small and will create havoc for larger accounts (p.s. all of this information is already on the report that's attached to the e-mail...so just open the attachment!!!!). But, assuming that won't fly, what is the best way to tackle this? Loop, select case, etc.?

Thanks
 
I'm thinking a "Do While Not rs.EOF" loop that builds a string:

"Location 1, Location 2"
 
Thanks, Paul! Worked like a charm. I'm curious to see what it does with a REALLY long string. I didn't have time to simulate a large client in the testing, so they got what they got. :D
 
I agree with your first post; beyond a few, I don't think it makes sense to have in the subject. Glad we got you going though!
 

Users who are viewing this thread

Back
Top Bottom