Newsletter and Title (Title not showing)

The below code walks a view and sends Newsletter e-mails to the userseverything works well except, I can not get the Title to show where it shows the link and title

Does anyone know what I am doing wrong for the title not to show?

Dim s As New NotesSession



Set db = s.CurrentDatabase

Set lkView = db.GetView ("LKEMail Profiles" )

Set lkDoc = lkView.GetDocumentByKey ("Nag1")

Set View = db.GetView("LKNag1")

Set doc = view.GetFirstDocument



While Not (doc Is Nothing )

	If(doc.sent(0) = "")Then			

		strWho = "AS400_File_Admin"		

		sUserName = s.UserName	

'Define Search

		f2$ = "FIELD ODCRTU = " & doc.ODCRTU(0)

		Set nlCollection = db.FTSearch( f2$, 0)

'Set up Newsletter

		Set newsletter = New NotesNewsletter( nlCollection )			

		newsletter.DoScore = False

		newsletter.DoSubject = True

                                            newsletter.SubjectItemName = doc.ODOBNM(0)

'Send e-mail Newsletter

		Set eDoc = newsletter.FormatMsgWithDoclinks( db )	

		

		'Alter who the E-Mail is comming from

		Principle = strWho			

		eDoc.Principal = Principle

		eDoc.From = Principal

		eDoc.AltFrom = Principle

		eDoc.SendFrom = Principle

		eDoc.INetFrom = Principle

		eDoc.tmpDisplaySentBy = Principle

		eDoc.tmpDisplayFrom_Preview = Principle

		eDoc.DisplaySent = Principle

		Set Item = New NotesItem(eDoc, "Form", "Memo")

		Set Item = New NotesItem(eDoc, "SendTo", sUserName)

		Set Item = New NotesItem(eDoc, "CopyTo", "")

		Set Item = New NotesItem(eDoc, "BlindCopyTo", "")

		

		Item.IsSummary = True

		Set Item = New NotesItem(eDoc, "Subject", lkDoc.epSubject(0) + " from " +  doc.ODCRTU(0))

		Item.IsSummary = True			

		Call eDoc.Send( False)

'Set doc field Sent to “Sent” so that agent does not send double newsletters

		Set nlDoc = nlCollection.GetFirstDocument

		While Not (nlDoc Is Nothing )

			nlDoc.sent = "Sent"

			Call nlDoc.save(True,False)

			

			Set nlDoc = nlCollection.GetNextDocument(nlDoc)

		Wend

	End If

	

	Set doc = view.GetNextDocument(doc)

Wend

Subject: Newsletter and Title (Title not showing)

What is the value of doc.ODOBNM(0).

Is the field you want to use for a title a normal text field with a Summary attribute (i.e. non RichText the value of which can appear in a view)?

Rufus.

Subject: RE: Newsletter and Title (Title not showing)

doc.ODOBNM(0) is a text field that is being pulled from the docs

I have even tried using text (ex “The title is”)

and still it did not have a title in the newsletter

Subject: RE: Newsletter and Title (Title not showing)

I just did this! :slight_smile: You would put itnewsletter.SubjectItemName = “ODOBNUM”

The string is the name of the field, which is also why just text doesn’t work.

Subject: RE: Newsletter and Title (Title not showing)

In the posting that started this tread, newsletter.SubjectItemName = “ODOBNUM” was to show that no matter what I set the ‘newsletter.SubjectItemName =’ to equal, it will not show up in the e-mailI have tried text and a field value and nothing works

Subject: RE: Newsletter and Title (Title not showing)

and like I stated"The string is the name of the field"

It is not just a random text string, it is not the value of the field. IT IS THE NAME of the field. If your field is ODOBNUM then you put

newsletter.SubjectItemName = “ODOBNUM”

If the name of your field is NAME, you put

newsletter.SubjectItemName = “NAME”

If the name of your field is LName, you put

newsletter.SubjectItemName = “LName”

Does that make sense?

Subject: RE: Newsletter and Title (Title not showing)

OK, now I am getting what you are saying.

Thank you it worked great!!!