| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
|
| 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. |
|
#2
|
| 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" 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. > |
|
#3
|
| "JF Main" 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 |
|
#4
|
| 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" >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" >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. >> |
|
#5
|
| 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" 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" > > >>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" >>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. >>> |
![]() |
| Thread Tools | |
| Display Modes | |