Lotus Script errors type Mismatch

Lotus scripting is getting over my head.

I have an issue I'm working on within an agent.  I have an autogenerated email  that builds the body of the email and then sends it.  within the message I want to send a value from the form that is getting selected for the email.  I have this AppendText :
Call rtitem.AppendText( "Incident Source:  " + src + Chr(13) + Chr(13) + "This is a Daily Notification Process indicating you have an open IR older than 5 days that Requires your attention. " + Chr(13) + "Please Open, Review and Update the IR." + Chr(13) + Chr(13) + "A Final Root Cause and Resolution are Required. " + Chr(13) + Chr(13) + "Thank You !" + Chr(13) + Chr(13) + "Open IR Document Link  ->  " )
            Call rtitem.AppendDocLink( curdoc, doc.Subject( 0 ) )

this is just a message body of the email.  I'm trying to add the first part, "Incident Source:  " + src + Chr(13) + Chr(13) +
the 2 chr gives me 2 line feeds.  The problem is when trying to add field value src I get the mismatch
I have it defined above as Dim src As NotesItem and then Set src = curdoc.GetFirstItem( "Incident" )

plus I'm trying to add the src value to the error at the end if there is one in this.
MsgBox "Error in Send: " + src & Error$

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Sjef BosmanGroupware ConsultantCommented:
Hi Paul,

A NotesItem is not a valid operand for the plus-operator that you use to concatenate strings. The ampersand-operator is more lenient when it comes to concatenation, but in this case it wouldn't have mattered: you simply cannot concatenate a string with a NotesItem. Try src.Text instead, for a quick fix.

I personally almost never work with GetFirstItem, when I know the type of the value of the field. If the Incident field contains one string value, you may get it using
   Dim s As String
   s= curdoc.GetItemValue("Incident")(0)
The call returns an array of values, so you need the (0) to get its first value.

Just another remark: instead of the chr(13) call you can
- use Chr$(13): this is a string, whereas Chr(13) returns a Variant which needs a conversion
- use rtitem.AddNewline(1): this is platform-independent, Chr$(13) is ASCII

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
pratiganAuthor Commented:
Fantastic... Sjef .. you are truly a master.
Thank You So Much !!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.

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.