RTF Tags or Codes?

This is a discussion on RTF Tags or Codes? within the lotus-notes-programmer forums in Other Technologies category; I am trying to interface an Access application with Notes email. I can create a Notes email doc, but only in plain Arial, even though it appears to be an RTF doc. Are there something like HTML tags that will allow me to code RTF docs and thus to change fonts and colors in the Notes doc? Thanks for any help....

Go Back   Database Forum > Other Technologies > lotus-notes-programmer

Database Forums

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 07-21-2008, 08:43 PM
Default RTF Tags or Codes?

I am trying to interface an Access application with Notes email. I
can create a Notes email doc, but only in plain Arial, even though it
appears to be an RTF doc.

Are there something like HTML tags that will allow me to code RTF docs
and thus to change fonts and colors in the Notes doc?

Thanks for any help.

Reply With Quote
  #2  
Old 07-24-2008, 07:50 AM
Default Re: RTF Tags or Codes?

Yes,
one way would be, instead of creating a RitchText document,
Dim eml
Set eml = doc.CreateRichTextItem("Body")

to use:
Set eml = doc.CreateMIMEEntity("Body")

Dim stm
Set stm = session.CreateStream
stm.WriteText "

bla bla bla

a second bla bla bla
....", EOL_NONE
eml.SetContentFromText stm, "text/html", ENC_NONE

This way you can set your email body as Html because you will generate a
MIME encapsulated document (not RTF).

When you create an attachment:
Dim att, dta
Set att = eml.CreateChildEntity
Set dta = session.CreateStream

dta.Open "path to your file"
att.SetHeaderValAndParams "attachment;
filename=""attachment-filename.dat"""
att.SetContentFromBytes dta, "application/octet-stream", ENC_NONE
att.EncodeContent ENC_BASE64
dta.Close


........ this is just to give you a hint. For further details you must
consult your documentation.


Regards,
Marian

"JF Main" schrieb im Newsbeitrag
news:hk7a84568h17h83skeh5smjqphvah822h2-at-4ax.com...
> I am trying to interface an Access application with Notes email. I
> can create a Notes email doc, but only in plain Arial, even though it
> appears to be an RTF doc.
>
> Are there something like HTML tags that will allow me to code RTF docs
> and thus to change fonts and colors in the Notes doc?
>
> Thanks for any help.
>

Reply With Quote
  #3  
Old 07-25-2008, 07:06 PM
Default Re: RTF Tags or Codes?

"JF Main" wrote in message
news:hk7a84568h17h83skeh5smjqphvah822h2-at-4ax.com...
>I am trying to interface an Access application with Notes email. I
> can create a Notes email doc, but only in plain Arial, even though it
> appears to be an RTF doc.
>
> Are there something like HTML tags that will allow me to code RTF docs
> and thus to change fonts and colors in the Notes doc?
>
> Thanks for any help.


Use the NotesRichTextItem class and NotesRichTextParagraphStyle class to
build the body field.
Or use Midas LSX from Geniesoft to get even more control over the
formatting.

Just to get you started, below I am inserting a function I write to
create a new document (intended to be mailed). The function takes one
argument, the NotesDocument where some data is retrieved from, and where
the doclink in the mail is pointing to. Nothing fancy, but it show how
you work with a rich text field.
Use the help file to figure out what everything does.

/Karl


Function CreateEmail(doc As NotesDocument) As NotesDocument
Dim session As New NotesSession
Dim Database As NotesDatabase
Dim rtitem As NotesRichTextItem
Dim maildoc As NotesDocument
Dim richStyle As NotesRichTextStyle

Set Database = session.CurrentDatabase
Set maildoc = New NotesDocument(Database)
Set rtitem = New NotesRichTextItem(maildoc,"Body")
maildoc.Form = "Memo"
Set richStyle = session.CreateRichTextStyle
richStyle.NotesFont = 1
richStyle.Bold = True
Call rtitem.AppendStyle(richStyle)
Call rtitem.AppendText("This is an automated mailing from " &
SystemTitle & ". Please do not reply to it.")
If Not doc Is Nothing Then
Call rtitem.AppendText(" Click here ")
Call rtitem.AppendDocLink( doc, "click here for document")
Call rtitem.AppendStyle(richStyle)
Call rtitem.AppendText(" to open the document.")
End If
Call rtitem.AddNewLine(1)
richStyle.NotesColor = 13
richStyle.Bold = False
Call rtitem.AppendStyle(richStyle)
Call rtitem.AppendText("Some more text...")
Call rtitem.AddNewLine(1)
Set CreateEmail = maildoc
End Function




Reply With Quote
  #4  
Old 07-25-2008, 08:38 PM
Default Re: RTF Tags or Codes?

Thanks for the post. I made a few modifications and I can now use MS
Access to write html code to a Notes email.

Unfortuantely, some html codes work and some don't. I think Notes
does not render them well or somethign.

Still enough do for me to be able to do most of what it need for
formattting.

Thanks for the help.

does anyone else wnat the code?


On Thu, 24 Jul 2008 12:50:49 +0200, "Marian Pascalau"
wrote:

>Yes,
>one way would be, instead of creating a RitchText document,
> Dim eml
> Set eml = doc.CreateRichTextItem("Body")
>
>to use:
> Set eml = doc.CreateMIMEEntity("Body")
>
> Dim stm
> Set stm = session.CreateStream
> stm.WriteText "

bla bla bla

a second bla bla bla
>...", EOL_NONE
> eml.SetContentFromText stm, "text/html", ENC_NONE
>
>This way you can set your email body as Html because you will generate a
>MIME encapsulated document (not RTF).
>
>When you create an attachment:
> Dim att, dta
> Set att = eml.CreateChildEntity
> Set dta = session.CreateStream
>
> dta.Open "path to your file"
> att.SetHeaderValAndParams "attachment;
>filename=""attachment-filename.dat"""
> att.SetContentFromBytes dta, "application/octet-stream", ENC_NONE
> att.EncodeContent ENC_BASE64
> dta.Close
>
>
>....... this is just to give you a hint. For further details you must
>consult your documentation.
>
>
>Regards,
>Marian
>
>"JF Main" schrieb im Newsbeitrag
>news:hk7a84568h17h83skeh5smjqphvah822h2-at-4ax.com...
>> I am trying to interface an Access application with Notes email. I
>> can create a Notes email doc, but only in plain Arial, even though it
>> appears to be an RTF doc.
>>
>> Are there something like HTML tags that will allow me to code RTF docs
>> and thus to change fonts and colors in the Notes doc?
>>
>> Thanks for any help.
>>

Reply With Quote
  #5  
Old 07-29-2008, 05:58 AM
Default Re: RTF Tags or Codes?

As much as I know, the Notes Session Object converts by default all MIME
formated emails to RTF (same does LotusNotes client before display) and some
HTML formating may get lost.

"JF Main" schrieb im Newsbeitrag
news:nrok84pl1jugaf1chv3gvip9bmoqeook38-at-4ax.com...
> Thanks for the post. I made a few modifications and I can now use MS
> Access to write html code to a Notes email.
>
> Unfortuantely, some html codes work and some don't. I think Notes
> does not render them well or somethign.
>
> Still enough do for me to be able to do most of what it need for
> formattting.
>
> Thanks for the help.
>
> does anyone else wnat the code?
>
>
> On Thu, 24 Jul 2008 12:50:49 +0200, "Marian Pascalau"
> wrote:
>
>>Yes,
>>one way would be, instead of creating a RitchText document,
>> Dim eml
>> Set eml = doc.CreateRichTextItem("Body")
>>
>>to use:
>> Set eml = doc.CreateMIMEEntity("Body")
>>
>> Dim stm
>> Set stm = session.CreateStream
>> stm.WriteText "

bla bla bla

a second bla bla bla
>>...", EOL_NONE
>> eml.SetContentFromText stm, "text/html", ENC_NONE
>>
>>This way you can set your email body as Html because you will generate a
>>MIME encapsulated document (not RTF).
>>
>>When you create an attachment:
>> Dim att, dta
>> Set att = eml.CreateChildEntity
>> Set dta = session.CreateStream
>>
>> dta.Open "path to your file"
>> att.SetHeaderValAndParams "attachment;
>>filename=""attachment-filename.dat"""
>> att.SetContentFromBytes dta, "application/octet-stream", ENC_NONE
>> att.EncodeContent ENC_BASE64
>> dta.Close
>>
>>
>>....... this is just to give you a hint. For further details you must
>>consult your documentation.
>>
>>
>>Regards,
>>Marian
>>
>>"JF Main" schrieb im Newsbeitrag
>>news:hk7a84568h17h83skeh5smjqphvah822h2-at-4ax.com...
>>> I am trying to interface an Access application with Notes email. I
>>> can create a Notes email doc, but only in plain Arial, even though it
>>> appears to be an RTF doc.
>>>
>>> Are there something like HTML tags that will allow me to code RTF docs
>>> and thus to change fonts and colors in the Notes doc?
>>>
>>> Thanks for any help.
>>>

Reply With Quote
Reply


Thread Tools
Display Modes



All times are GMT -4. The time now is 04:11 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Integrated by bbpixel2008 :: jvbPlugin R1013.368.1

Search Engine Friendly URLs by vBSEO 3.1.0
vB Ad Management by =RedTyger=
In an effort to better serve ads to our visitors, cookies are used on Mydatabasesupport.com. For more information, check out our Privacy Policy.