Text Formatting

Hey All,

I have some fields that I write out in an email body. I want to have a table appearance without the table so that the formatting looks pretty.

Currently I use ‘chr$(9) + chr$(9)’ to tab 2x but if the values in the first filed are too diverse in length I still get disjointed appearance.

Any suggestions?

Thanks,

Shawn

Subject: Text Formatting

I have done this using script by swithching to a send form (which is layed out as you like for the email) and then the renderToRTItem method for getting the send form into an e-mail body.

Or take a look at notesrichtexttable class in designer help.

I assume you are referencing field values from a document that you wish to build into an e-mail?

Subject: RE: Text Formatting

Thanks Tom, That is what I am doing.

If I understand your first option correctly, you are using a form with no RTI, just a plain text field (This is the part I am grey on) to write your text into initially?

If I had the formatting down I would be set, that is what I am trying to gather. Currently my columns don’t line up becuase the items in it vary in length like:

John Jacob Jingle Heimer Schmidt

John Doe

Then I add two tabs to the end of each name trying to achieve my spacing. However, obviously it won’t line up since the difference between the names (in length) is too great.

So what I need is a way to position my cursor before I write the next piece of data.

Something like:

gotoTabPosition(position as integer)

or

setCursorPosition(position as integer)

Does anything like that Exist?

The desired look I want is something like

name date

name date

Thanks,

Shawn

Subject: RE: Text Formatting

If you take a look at what rendertoRTItem does, it might help you understand. It takes a picture of the notes document.

Here is an example of what I am talking about:

HoldForm = Doc.Form(0)

Call Doc.Save(True,False)

Set MailDoc = db.CreateDocument

Doc.Form = “YourNiceFormattedForm” 'swithc forms

MailDoc.Subject = “Your Subject”

Set TmpRTItem = New NotesRichTextItem( MailDoc, “Body”)

Success = doc.RenderToRTItem(TmpRTItem) 'this is what puts the doc into the mail doc

Doc.Form = HoldForm 'switch back to the original form

MailDoc.SendTo = GetSendToGroup

Call MailDoc.Send(False)

Call Doc.Save(True, False)

(not tested - just off the top of my head but this method works)

Subject: RE: Text Formatting

Therein lies the rub, I do not have a nice formatted form. I have documents that contain the data and I want to create the formatting.

Here is what I have so far:

While Not (timeDocument Is Nothing)

		' Make sure the document type is correct

		If timeDocument.HasItem("EntryDate") Then

			' Make sure the Time Slips are within the report window

			Set timeSlipDate = getTimeSlipEntryDate(timeDocument) ' pull the entry date off of the time slip

			If (timeSlipDate.DateOnly <= reportEndDate.DateOnly) And (timeSlipDate.DateOnly >= reportStartDate.DateOnly) Then

				If timeDocument.CustNum(0) = "318" Then ' isolate just the customer records with the customer number

					rtItem.AppendText(timeDocument.EmpName(0)  +  Chr(9) +  Chr(9)  + " - ")

					rtItem.AppendText(timeDocument.Cust(0) + "     ")

					rtItem.AppendText(timeDocument.EntryDate(0) + "     ")

					rtItem.AppendText(Cstr(timeDocument.hrsNum(0))+ "     ")

					rtItem.AppendText(timeDocument.Cmts(0))

					rtItem.AddNewline(1) ' Add one carriage return

				End If

			End If

		End If

		

	' Grab the next time entry

		Set timeDocument = workRecords.GetNextDocument(timeDocument)

	Wend

This produces an OK result. Not great but barely adequate. I want to align the data in columns as I write it out to the RTI.

So each append Text entry above would be neatly organized in the email that is received.

Cheers,

Shawn