Set "FROM" field on memo doc

I have this code to send an e-mail out monthly - it is working, however I have the “From” field set to come from “Kristy Kline” and it is not - it is coming “From” me since I saved the message. Any ideas how to get this to come from Kristy?

Sub Initialize

Dim session As New Notessession

Dim db As NotesDatabase

Dim collection As NotesDocumentCollection

Dim doc As NotesDocument

Dim maildoc As NotesDocument



Set db=session.currentdatabase

Set view=Db.getview("PattyOverdueNoBackup")

Set doc=view.getfirstdocument

If doc Is Nothing Then Error 1000, _

"Doc not found in view."



Dim sendto As String



view.AutoUpdate = False

Set doc = view.GetFirstDocument

While Not (doc Is Nothing)

	

	Set nextdoc = view.GetNextDocument(doc)

	sendto = doc.creator(0)

	

	If sendto <> "" Then

		Set maildoc=db.createdocument

		maildoc.form="Memo"

		maildoc.from="Kristy Kline"

		maildoc.subject="Solicitation Back-up has not been received"

		maildoc.body="We still have not received back-up (proposal, letter, documentation, etc.) for the " + doc.Prospect(0) +_

		" solicitation request you submitted through Lotus Notes on " + Cstr(doc.SubmitDate(0)) + ".  Please mail back-up to " +_

		"Kristy Kline (12B Old Main), or send as an attachment via e-mail (klk31@psu.edu), or fax to 814-865-2965 at your earliest convenience.  " +_

		"If you have any questions, please call Kristy at 814-863-4302." + Chr(13) + Chr(13) +_

		"If you feel you have received this message in error, please forward this message onto Patty Bennett (pyb2@psu.edu) " +_

		"for her to review why you did receive it." + Chr(13) + Chr(13) +_

		"Thank you."

		

		maildoc.sendto=sendto

		

		success=maildoc.ComputeWithForm(False,False)

		If success Then

			Call maildoc.Send(False)

		End If

	End If

	

	Call doc.Save(True, True)

	Set doc=nextdoc

Wend

End Sub

Subject: Set “FROM” field on memo doc

Try setting the “Principle” field to Kristy also.

Subject: RE: Set “FROM” field on memo doc

I don’t have a principle field? Is this a standard field or something I have to create?

Subject: RE: Set “FROM” field on memo doc

Wouldn´t that be “PrincipAL” ?

doc.Principal = “John Doe”

Subject: RE: Set “FROM” field on memo doc

Please excuse me for my ignorance, but I don’t have a principal field on my memo form . . . where does that come from and why does it need set?

Subject: RE: Set “FROM” field on memo doc

I looked through your code, and I don’t see you adding a Principle item (field). Remember, when you build a memo from scratch, it is just a notes document. No form is associated with it to automatically include the field, even though you set the form to “memo”. You have to create it.

  • Matt

Subject: RE: Set “FROM” field on memo doc

So, by adding:

maildoc.principle (or is it principAL) = “Kristy Kline” then it should come from Kristy?

Subject: RE: Set “FROM” field on memo doc

Principal. Check this thread out (or search for “Principal and From” in this forum):

http://www-10.lotus.com/ldd/nd6forum.nsf/55c38d716d632d9b8525689b005ba1c0/ce0cd996db24e5ca8525725e00550884?OpenDocument

Subject: RE: Set “FROM” field on memo doc

Thank you, Matt. This worked! And, I appreciate the explanation!!

~ Patty

Subject: RE: Set “FROM” field on memo doc

sorry…yes it should be Principal. Not sure how I did that.