请问:有关RTF域中用代码生成表格以及用代码操作的有关问题
发布时间:2010-06-13 13:48:23 文章来源:www.iduyao.cn 采编人员:星星草
请教:有关RTF域中用代码生成表格以及用代码操作的问题?
数据库中表单FORM中有一个AA的RTF域和BB域,请教
1:如何用代码在AA域中生成一个5行4列的表格
2:如何用代码设置表格的列标题
3:另外设置一个按钮,标题属性为增加一行,代码该如何写
谢谢
------解决方案--------------------
看看Notes帮助的例程吧。
1. This agent creates a document, creates a table in a rich text item in the document, saves the document, then gets the table and displays its properties.
%INCLUDE "lsconst.lss"
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Set db = session.CurrentDatabase
REM Create new document with rich text item
Dim doc As New NotesDocument(db)
Call doc.AppendItemValue("From", session.UserName)
Call doc.AppendItemValue("Form", "Main Form")
Call doc.AppendItemValue _
("Subject", Inputbox("Subject?"))
Dim rti As New NotesRichTextItem(doc, "Body")
Call rti.AppendText("Paragraph of text")
Call rti.AddNewLine(2)
REM Create a table
Dim rows As Integer, columns As Integer
rows = 4
columns = 3
Dim tabs() As String
If Messagebox("Do you want a tabbed table?", _
MB_YESNO + MB_ICONQUESTION, "Tabbed?") = IDNO Then
Call rti.AppendTable(rows, columns)
Else
Redim tabs(1 To rows)
For i = 1 To rows
tabs(i) = "Row " & i
Next
Call rti.AppendTable(rows, columns, tabs)
End If
REM Save the document
Call doc.Save(True, False)
REM Get the table
Dim rtnav As NotesRichTextNavigator
Set rtnav = rti.CreateNavigator
If Not rtnav.FindFirstElement(RTELEM_TYPE_TABLE) Then
Messagebox "Could not find table",, "Fatal error"
Exit Sub
End If
Dim rtt As NotesRichTextTable
Set rtt = rtnav.GetElement
labelString = ""
Forall label In rtt.RowLabels
If label <> "" Then labelString = labelString & Chr(13) & _
" " & label
End Forall
If labelString = "" Then labelString = "No labels"
Messagebox "Columns = " & rtt.ColumnCount & Chr(13) & _
"Rows = " & rtt.RowCount & Chr(13) & _
"Labels = " & labelString & Chr(13) & _
Style = " & rtt.Style & Chr(13) & _
"Color = " & rtt.Color.NotesColor & Chr(13) & _
"AlternateColor = " & rtt.AlternateColor.NotesColor _
,, "NotesRichTextTable"
End Sub
2. This view action creates a basic auto-width table of 4 rows and 3 columns, and populates it.
Sub Click(Source As Button)
Dim session As New NotesSession
Dim db As NotesDatabase
Set db = session.CurrentDatabase
REM Create document with Body rich text item
Dim doc As New NotesDocument(db)
Call doc.ReplaceItemValue("Form", "Main topic")
Call doc.ReplaceItemValue("Subject", "Table 4 x 3")
Dim body As New NotesRichTextItem(doc, "Body")
REM Create table in Body item
rowCount% = 4
columnCount% = 3
Call body.AppendTable(rowCount%, columnCount%)
REM Populate table
Dim rtnav As NotesRichTextNavigator
Set rtnav = body.CreateNavigator
Call rtnav.FindFirstElement(RTELEM_TYPE_TABLECELL)
For iRow% = 1 To 4 Step 1
For iColumn% = 1 To 3 Step 1
Call body.BeginInsert(rtnav)
Call body.AppendText("Row " & iRow% & ", Column " & iColumn%)
Call body.EndInsert
Call rtnav.FindNextElement(RTELEM_TYPE_TABLECELL)
Next
Next
REM Save document and refresh view
Call doc.Save(True, False)
Dim ws As New NotesUIWorkspace
Call ws.ViewRefresh
End Sub
3. This agent gets the cells in the first table in an item and displays the first text paragraph in each cell.
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。
其他相似内容:
-
问各位初学lotus notes开发看什么书
问各位初学lotus notes开发看什么书,如果有共享的话就谢谢大家了
------解决方案-----------...
-
简单的语法,请大侠看看!!
我是刚入门的菜鸟,我想添加我在视图中选择多个IP地址,并把它们放到address这个域当中,如果我用@PickList这个...
-
如何屏蔽或隐藏notes文件菜单中的引出按钮?
出于安全考虑,要隐藏引出按钮?
------解决方案--------------------
CS的话可以修...
-
c/s下如何封CTRL+C CTRL+V?
谢谢!
------解决方案--------------------
给数据库acl加权限,禁止复制...
-
domino 可以改变域的容量吗?
domino 可以改变域的容量吗?32kb改成更大一点的
------解决方案--------------------
普通域大小不...
-
Domino用户重复的问题 请大侠们指教~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
各位好 目前遇到如下问题
A服务器是主...
-
用js 怎样截取字符串?
var str="C:\Documents and Settings\dell\桌面\guanxi4.bmp"
我只需要 guanxi4.bmp 用js 怎样...
-
domino 自动编号
设计重1开始编号,依次不重复的,有好的建议吗?
------解决方案--------------------
再看以前发的一个帖子,对你有...
-
请高手进来看看:表单提交报错。
表单提交的时候报错:HTTP Web Server: Item value exceeds maximum allowable size. [/oadata/ccc....
-
Lotus Notes 8.5 发邮件时错误提示 failed to authenticate
如标题。
只有一个账户,点发邮件的时候有这样的错误提示,其他账户都正...