Domino 9 und frühere Versionen > ND8: Entwicklung

HTML-Code in Body einfügen

<< < (5/5)

umi:
Hallo
Evtl. liegt es daran, dass Du nicht mit HTML Code anfängst.
evtl. funktioniert folgendes:

--- Code: ---Dim ws As New NotesUIWorkspace
ws.currentdocument.InsertText("[<span>Dies ist nur ein <b>Test</b>:</span>]")

--- Ende Code ---


--- Zitat von: atbits am 31.08.10 - 13:58:59 ---FE = FrontEnd = UI
BE = Backend

Also mit @Command(... ging es nicht

und mit


--- Code: ---Dim ws As New NotesUIWorkspace
ws.currentdocument.InsertText("[Dies ist nur ein <b>Test</b>:]")

--- Ende Code ---

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.

--- Ende Zitat ---

schroederk:
Leider liegt es auch daran nicht. Es wird schlicht alles so ausgegeben wie angegeben.

Ich werde wohl, wie empfohlen, die Signatur bereits in Richtext erfassen lassen, damit sind sicherlich ein paar Funktionen nicht verfügbar, aber sicherlich die meisten.

Tode:
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:


--- Code: --- 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

--- Ende Code ---

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

Navigation

[0] Themen-Index

[*] Vorherige Sete

Zur normalen Ansicht wechseln