celcius233
asked on
Carriage Returns
Hello.
Trying to put some carriage returns in an email I'm generating using MAPI in VB6 (kind of new to this, so forgive me if it's an easy one). Basically the email is being generated the way a normal email would, however I need to take this:
Date: nnnnnnn Time: nnnnnn Submitted by: xxxxx Approved by: xxxxx
and make it this:
Date
Time
Submitted by
Approved by
The fields are being populated by textbox values on the form and also a combobox.
Any info is appreciated.
Celcius
Trying to put some carriage returns in an email I'm generating using MAPI in VB6 (kind of new to this, so forgive me if it's an easy one). Basically the email is being generated the way a normal email would, however I need to take this:
Date: nnnnnnn Time: nnnnnn Submitted by: xxxxx Approved by: xxxxx
and make it this:
Date
Time
Submitted by
Approved by
The fields are being populated by textbox values on the form and also a combobox.
Any info is appreciated.
Celcius
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
What I've done is put a large, multiline "txtAll" textbox at the bottom of my form. It grabs all the values of the other textboxes as follows:
txtAll.Text = Textbox1 & vbNewLine & Textbox2 & vbNewline
Where Textbox1 = "Date: nnnnnnn", Textbox2 = "Time: nnnnnn", etc.
I'm auto-populating Outlook emails via code, so I need to replace vbNewline with HTML <br> tags; not sure if Mapi is the same. I use the following string to populate my email's olMail.Body:
Dim strTotalofTextboxes as String
strTotalofTextboxes = Replace(txtAll.Text, vbNewLine, "<br>")
This works on a string like: Date:nnnnnnn Time:nnnnnn Submitted by:xxxxx Approved by:xxxxx