Solved

Help with some code

Posted on 2012-04-05
7
211 Views
Last Modified: 2012-06-21
Hi All,

Ive got a application which was written by a developer who has long left the company. Im not a coder but Ive been able to muddle my way through various changes over the past couple of year but today, Ive come up against something which I thought would be a piece of cake but alas its not.

The application in question runs a serious of reports and emails them out to a user. The email body has the text "Please find attached today's report". I want to change this so it says the following:-

Please find attached today's

Status Key
 

ENQ - Enquiry Received

APP - Application Passed to Underwriting

SEL -   Ready to Sell

SLD - Loan Sold

ROI - Regulated Offer Issued

UOI - Unregulated Offer Issued

RCE - Regulated Consideration Expired

WIP - Work in Progress

PPO - Pending Payout

SLC -   Secured Loan Completion

REJ -   Application Rejected

TUD - Customer Turned Us Down

TPD - Third Party Deal

DUP - Duplicate lead received within 30 days


Now, Ive opened up the code in VB Studio and Ive found the line which inserts the "Please find attached todays report" and Ive appended the string to include all the rest of what I want included in the email body. When I do this, in the error list of the VB Studio I see loads of new errors so I guess Im not able to insert the additional text.

SendOutEmail(strEmailSender, strEmailList.ToString, _
                    String.Concat(strSelectedReport.Substring(strSelectedReport.LastIndexOf("\") + 1), " - ", _
                    arrSourceCodesList(intNumberOfSources)), "Please find attached today's report.", arrFileList) ' -- Send mail

How would I get the email body string updated to include my extra text?

Ta
D
0
Comment
Question by:daiwhyte
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 9

Expert Comment

by:wasiftoor
ID: 37810602
If your text is a static statement you can just but that along with the "Please find attached ....." statement. Within in the quotes (" ") as shown below

"Please find attached today's report.   Your new Text here"

Otherwise you if your text is part of a variable String you can concatenate it as


"Please find attached today's report." & varNewstring.


Good Luck!
0
 

Author Comment

by:daiwhyte
ID: 37810798
I want the text to look like this

Please find attached today's report

Key for Status

etc
etc
etc
etc


The trouble is,when hiit return after the word "report" so I start a new line, I get errors on the error list.

If I just add to the existing string and not hit enter, Im able to insert text but this wont look right in the email body.
0
 
LVL 22

Expert Comment

by:plusone3055
ID: 37811560
Please find attached today's report &  vbCrLf  &   "Key for Status" & vbCrLf & ect & vbCrLf & ect
0
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 
LVL 22

Accepted Solution

by:
plusone3055 earned 500 total points
ID: 37811578
"Please find attached today's report." & vbCrLf & "Key for Status" & vbCrLf & "ect" & vbCrLf

Or if this is using ASP.NEt just make a web control txt File
0
 
LVL 22

Expert Comment

by:plusone3055
ID: 37811601
simple waty to do this would be...
Create a new text file to the App_data folder on your website
name it Emailbody.txt

in the txtfile enter the body you want
Please find attached today's report

Key for Status

etc
etc
etc
etc



then in your code with the email
 If Page.IsValid Then
Dim fileName As String = Server.MapPath(“~/App_Data/Emailbody.txt”)
Dim mailBody As String = System.IO.File.ReadAllText(fileName)
0
 
LVL 12

Expert Comment

by:Anuradha Goli
ID: 37815702
SendOutEmail(strEmailSender, strEmailList.ToString, _
                    String.Concat(strSelectedReport.Substring(strSelectedReport.LastIndexOf("\") + 1), " - ", _
                    arrSourceCodesList(intNumberOfSources)), "Please find attached today's report.", arrFileList) ' -- Send mail


Replace "Please find attached today's report." with

"Please find attached today's report. \n Key for Status \n"
or
"Please find attached today's report."& vbCrLf &"Key for Status"
0
 

Author Closing Comment

by:daiwhyte
ID: 37837078
Worked a charm. Thanks
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question