Domino 9 und frühere Versionen > ND8: Entwicklung
"Infobrief-Zusammenfassung senden" - als LS ?
Bruce Willis:
Hi,
anbei meine Ergebnisse...
Kann man die Infomail schöner formatieren?
Chr(9)) reicht nicht aus, da die Länge von Inhalten der Spalten sehr unterschiedlich sein kann...
Gruß
Leo
Sub Initialize()
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument
Dim message As NotesDocument
Dim rtitem As variant
Set db = session.currentdatabase
Set view = db.GetView("LeoAnsicht")
Set doc = view.GetFirstDocument
Set message = New NotesDocument(db)
Set rtitem = New NotesRichTextItem( Message, "Body" )
Message.Form = "Memo"
Message.Principal = "Bruce Willis/World"
Message.SendTo = "Leo/World"
Message.Subject = "Hello World"
Call rtitem.AppendText( "Hi there")
Call rtitem.AddNewLine( 2)
While Not doc Is Nothing
Call rtitem.AppendDocLink( doc, "" )
Call rtitem.AppendText( " " + Left(doc.From(0),10) + Chr(9))
Call rtitem.AppendText( Left(doc.SendTo(0),10) + Chr(9))
Call rtitem.AppendText( Left(doc.Subject(0),20) + Chr(9))
Call rtitem.AppendText(doc.DeliveredDate(0))
Call rtitem.AddNewLine( 1)
Set doc = view.GetNextDocument(doc)
Wend
Call rtitem.AppendText( "Best regards" )
Call rtitem.AddNewLine( 1)
Call Message.Send( False )
End Sub
koehlerbv:
Klar, man kann die Ruler entsprechend setzen (NotesRichTextParagrahStyle class und "Kinder" davon).
Und dort wirst Du noch einiges mehr finden, was die simple Aktion Dir nicht bietet.
Bernhard
Bruce Willis:
Danke, Bernhard.
Ich habe den Code entsprechend erweitert, aber die 3. und 4. Spalten der Infomail kommen trotzdem durcheinander.
Weißt Du, was man noch ändern muss?
Gruß
Leo
Sub Initialize()
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument
Dim message As NotesDocument
Dim rtitem As Variant
Dim pMailAddress As String
Set db = session.currentdatabase
Set view = db.GetView("LeoAnsicht")
Set doc = view.GetFirstDocument
Set message = New NotesDocument(db)
Set rtitem = New NotesRichTextItem( Message, "Body" )
Dim richStyle As NotesRichTextStyle ' Leo Style
Set richStyle = session.CreateRichTextStyle ' Leo Style
richstyle.NotesFont = 4 ' Leo Style - "vorgabe feste breite"
Dim rtpStyle As NotesRichTextParagraphStyle ' Leo Align Left
Set rtpStyle = session.CreateRichTextParagraphStyle ' Leo Align Left
rtpStyle.Alignment = ALIGN_LEFT ' Leo Align Left
Dim pos As Long ' Leo Ruler
pos = RULER_ONE_CENTIMETER * 7 ' Leo Ruler
'Call rtpStyle.SetTab(pos, TAB_DECIMAL) ' Leo Ruler
Call rtpStyle.SetTab(pos, TAB_LEFT) ' Leo Ruler
Message.Form = "Memo"
Message.Principal = pMailAddress
Message.Principal = "Bruce Willis/World"
Message.SendTo = "Leo/World"
Message.Subject = "Hello World"
Call rtitem.AppendStyle(richStyle) ' Leo Style
Call rtitem.AppendParagraphStyle(rtpStyle) ' Leo Align Left
Call rtitem.AddTab(1)
Call rtitem.AppendText( "Hi there")
Call rtitem.AddNewLine( 2)
While Not doc Is Nothing
' in Common Names konvertieren
Dim nam As NotesName
Set nam = session.Createname(doc.From(0))
Dim nam1 As NotesName
Set nam1 = session.Createname(doc.SendTo(0))
Call rtitem.AppendDocLink( doc, "" )
Call rtitem.AppendText( " " + Left( nam.common ,15))
Call rtitem.AddTab(1)
Call rtitem.AppendText( Left( nam1.common ,15) )
Call rtitem.AddTab(1)
Call rtitem.AppendText( Left(doc.Subject(0),30))
Call rtitem.AddTab(1)
Call rtitem.AppendText( doc.DeliveredDate(0))
Call rtitem.AddNewLine( 1)
Set doc = view.GetNextDocument(doc)
Wend
Call rtitem.AppendText( "Best regards" )
Call rtitem.AddNewLine( 1)
Call Message.Send( False )
End Sub
koehlerbv:
Wie wäre es mit dem Setzen eines zweiten und dritten Tabs?
Bernhard
Bruce Willis:
--- Zitat von: koehlerbv am 16.04.10 - 00:09:36 ---Wie wäre es ...?
--- Ende Zitat ---
Bestimmt cool!
Aber wie?
So geht es anscheinend nicht:
Dim rtpStyle As NotesRichTextParagraphStyle ' Leo Align Left
Set rtpStyle = session.CreateRichTextParagraphStyle ' Leo Align Left
'rtpStyle.Alignment = ALIGN_LEFT ' Leo Align Left
Dim pos As Long
Dim interval As Long
pos = RULER_ONE_CENTIMETER
interval = RULER_ONE_CENTIMETER * 5
Call rtpStyle.SetTabs(6, pos, interval, TAB_LEFT)
Message.Form = "Memo"
Message.Principal = "Bruce Willis/World"
Message.SendTo = "Leo/World"
Message.Subject = "Hello World"
Call rtitem.AppendStyle(richStyle) ' Leo Style
Call rtitem.AppendParagraphStyle(rtpStyle) ' Leo Align Left
Call rtitem.AppendText( "Hi there")
Call rtitem.AddTab(1)
Call rtitem.AppendText( "Hi there")
Call rtitem.AddTab(1)
Call rtitem.AppendText( "Hi there")
Call rtitem.AddTab(1)
Call rtitem.AppendText( "Hi there")
Call rtitem.AddTab(1)
Call rtitem.AppendText( "Hi there")
Call rtitem.AddTab(1)
Call rtitem.AppendText( "Hi there")
Call rtitem.AddNewLine( 2)
While Not doc Is Nothing
' in Common Names konvertieren
Dim nam As NotesName
Set nam = session.Createname(doc.From(0))
Dim nam1 As NotesName
Set nam1 = session.Createname(doc.SendTo(0))
Call rtitem.AppendDocLink( doc, "" )
Call rtitem.AppendText( " " + Left( nam.common ,13))
Call rtitem.AddTab(1)
Call rtitem.AppendText( " " + Left( nam1.common ,18) )
Call rtitem.AddTab(1)
Call rtitem.AppendText( Left(doc.Subject(0),22))
Call rtitem.AddTab(1)
Call rtitem.AppendText( doc.DeliveredDate(0))
Call rtitem.AddNewLine( 1)
Navigation
[0] Themen-Index
[#] Nächste Seite
[*] Vorherige Sete
Zur normalen Ansicht wechseln