Hallo,
ich würde gerne über einen Button HTML-Code im Body einer neuen Mail einfügen, sodass dieser natürlich auch als solcher angezeigt wird.
Über
@Command([EditInsertText]; @NewLine + @NewLine + "Dies ist nur ein <b>Test</b>:" + @NewLine);
wird leider der HTML-Code als Text angezeigt.
Ich denke, dass dies über das MIME-Format geregelt wird, aber wie stelle ich dies um, wenn der Body ja schon existiert?
@eknori: war auch meine erste Idee, funktioniert meiner Meinung nach aber nur im BE.
Für mich klingt es aber so, als wollte SchroederK das im FE machen. Warum dann eigentlich kein Richtext einfügen?
Grüße David
Jo das tut net:
@Command([EditInsertText]; @NewLine + @NewLine + "[Dies ist nur ein <b>Test</b>:]" + @NewLine);
FE = FrontEnd = UI
BE = Backend
Also mit @Command(... ging es nicht
und mit
Dim ws As New NotesUIWorkspace
ws.currentdocument.InsertText("[Dies ist nur ein <b>Test</b>:]")
auch nicht.
Ich mache sowas auch ganz oft im Web, oder zum Versand von Emails im Backend, aber im Frontend hat das bei mir bisher immer nur mit RichText geklappt.
Bevor ich mich weiter falsch ausdrücke ...
Was muss ich machen, damit ich über einen einfachen neuen Button in einer mail85-Standard-Schablone Text so einfügen kann,
dass dieser vom Notes 8.5.1 FP4 Standard-Client so angezeigt wird, dass Textformatierungen, wie Schriftgröße und Fettdruck zu sehen sind?
Der Standard-Button sieht momentan so aus :
testtext := "[<b>Alles in fett</b>]";
@Command([EditGotoField];"Body");
@Command([EditInsertText]; @NewLine + @NewLine + "Dies ist nur ein Test:" + @NewLine + testtext);
@Command([EditGotoField];"Body");
@Command([RefreshHideFormulas]);
@Command([ViewRefreshFields])
Hallo
Evtl. liegt es daran, dass Du nicht mit HTML Code anfängst.
evtl. funktioniert folgendes:
Dim ws As New NotesUIWorkspace
ws.currentdocument.InsertText("[<span>Dies ist nur ein <b>Test</b>:</span>]")
FE = FrontEnd = UI
BE = Backend
Also mit @Command(... ging es nicht
und mit
Dim ws As New NotesUIWorkspace
ws.currentdocument.InsertText("[Dies ist nur ein <b>Test</b>:]")
auch nicht.
Ich mache sowas auch ganz oft im Web, oder zum Versand von Emails im Backend, aber im Frontend hat das bei mir bisher immer nur mit RichText geklappt.
Mal ne blöde Frage: Warum speicherst Du den HTML- Code nicht als File (z.B. ins Temp- Verzeichnis) und benutzt dann die NotesUIDocument.Import:
Call uidoc.Import( "HTML File" , filePath )
natürlich muss Dein Cursor an der richtigen Stelle im Richtext- Feld stehen, aber ansonsten funktioniert das wunderbar....
Hier mal ein Auszug aus einer "dynamisch" generierten Signatur:
sigHTMLs = "<HTML>"
sigHTMLe = "</HTML>"
sigTITLEs = "<TITLE>"
sigTITLEe = "</TITLE>"
sigBODYs = "<BODY>"
sigBODYe = "</BODY>"
sigFONT1s = |<FONT STYLE="font-size: 10pt; color: black; font-family: 'Arial'">|
sigFONT2s = |<FONT STYLE="font-size: 8pt; color: black; font-family: 'Arial'">|
sigFONT3s = |<FONT STYLE="font-size: 8pt; color: #00a973; font-family: 'Arial'">|
sigFONTe = "</FONT>"
tmpPath = getTmpPath
filePath = tmpPath & "signature.html"
On Error Resume Next
Kill filePath
On Error GoTo 0
Open filePath For Output As fileNr
Print #fileNr , sigHTMLs
Print #fileNr , sigTITLEs & sigTITLEe
Print #fileNr , sigBODYs
Print #fileNr , sigFONT1s
Print #fileNr , "<BR />"
ForAll value In arrLongSignature
Print #fileNr , value
Print #fileNr , "<BR />"
End ForAll
If Not docCompany Is Nothing Then
arrLongDisclaimer = Evaluate( |@Explode( CompanyDisclaimer ; @Char( 0 ) : @Char( 10 ) : @Char( 13 ) )| , docCompany )
arrLongDisclaimer = Replace( arrLongDisclaimer , badWords , goodWords )
ForAll value In arrLongDisclaimer
Print #fileNr , value
Print #fileNr , "<BR />"
End ForAll
End If
Print #fileNr , "<BR />"
Print #fileNr , "<BR />"
Print #fileNr , sigFONTe
Print #fileNr , sigBODYe
Print #fileNr , sigHTMLe
Close #fileNr
Call uidoc.Import( "HTML File" , filePath )
Kill filePath
Deklarationen fehlen, ausserdem die Funktion "getTmpPath" sowie die Information, woher docCompany kommt, aber so vom Prinzip her sollte es klar sein..
Das ganze kann man natürlich auch mit einem Stream machen...
HTH
Tode