Subject: How do I… (email text alignment question)
Yep… Plain text means no format.
You’ll have to use MIME
Things to check.
On Notes Client:
File - Preferences - User Preference
Mail (left nav) - Internet (sub of mail)
Internet Mail Format: HTML Only or HTML and Plain Text
In your location document (located in names.nsf(local)), on the Mail (tag)
Format for messages address to Internet addresses: MIME Format
- In creating email: View - Show - Pass-Thru HTML.
Check if sent in MIME by looking a few fields have been added such as they have MIME in the field name. ($NoteHasNativeMIME, MIME_Version, etc…)
With the script.
------ LOTUS’s CORRECT WAY OF DOING IT --------
'Dim currentdoc As NotesDocument
'Dim session As New NotesSession
Dim rtstyle As NotesRichTextStyle
Dim rtpstyle As NotesrichTextParagraphStyle
Set rtitem = currentdoc.GetFirstItem(“Body”)
Set rtstyle = session.CreateRichTextStyle
Set rtpStyle = session.CreateRichTextParagraphStyle
With rtstyle
.NotesFont = rtitem.GetNotesFont(“Arial”, True)
.FontSize = 10
.NotesColor = COLOR_BLACK
.Bold = False
End With
’ Add all your previous script here.
Call rtitem.AppendStyle(rtstyle)
rtitem.Appendtext(Chr(10))
’ ALIGN_RIGHT = 1
rtpStyle.Alignment = ALIGN_RIGHT
Call richText.AppendParagraphStyle(rtpStyle)
rtitem.Appendtext(“Yours sincerely,” + Chr(10) + Chr(10))
rtirem.Appendtext(session.CommonUserName + Chr(10))
’ ALIGN_LEFT = 0
rtpStyle.Alignment = ALIGN_LEFT
Call richText.AppendParagraphStyle(rtpStyle)
--------END CORRECT WAY -------------------------
------- ANOTHER CHEATS WAY ----------------------
’ Reasoning behind the cheats way is that Notes Styles are sometimes a headache.
’ They don’t always format correctly.
and also too long in their code.
’ source = NotesUIDocument
temp$ = Environ(“Temp”)
fileNum% = Freefile()
fileName$ = temp$ + “\signature.html”
Open fileName$ For Output As fileNum%
’ Add HTML code here
Print #fileNum%, “”
Print #fileNum%, “<span style=”“font-family: text-align: right; helvetica,arial,sans-serif; font-size: 13px;”“>
”
Print #fileNum%, “Your Sincerely,
”
Print #fileNum%, session.CommonUsername + “
”
Close fileNum%
Call source.Import (“HTML File”, fileName$)
Kill fileName$
------ END CHEATS WAY --------------------------
If you have to use plain text then you can fudge it with adding a line of spaces i.e
'Text$ can be assign to the line of text
text$ = “Your Sincerely,”
RightMargin = 72
newtextline = Left(Space(RightMargin), RightMargin - Len(text$)) + text$
This method can cause a problem if recipient sets plain text font as a variable text i.e Arial spacing is not the same with each character. It would look messy.
I hope I’ve helped in some way or given you a point in the right direction.