2

有没有办法在 Lotusscript 中设置部分的样式?我想模仿莲花笔记中用于回复历史的部分类型。

使用莲花脚本

  1. 设置边距,使该部分出现在最左边。

  2. 设置部分样式,使其显示为用于回复历史记录的“表样”部分标题。

我可以看到如何设置颜色、字体等。但我看不到如何设置该部分的实际样式。

4

2 回答 2

1

查看您的个人资料,您已经熟悉 Xpages。

如果应用程序不复杂,我会选择 Xpages。由于造型比传统更容易。笔记应用。对我来说就是这样。

这是一个 lotusscript 示例,它在备忘录中创建部分,因为我不确定您正在制作哪种应用程序以及适用于什么平台、笔记、网络或两者兼而有之。

打破标准是一个例子,它使用邮件文件和备忘录表单并将部分和文本放在邮件正文中

这是代码

   Sub Initialize
   Dim session As New NotesSession
   Dim mailDb As New NotesDatabase("", "")
   Dim ws As New NotesUIWorkspace
   Dim doc As NotesDocument
   Dim body As NotesRichTextItem
   Dim style As NotesRichTextStyle
   Dim color As NotesColorObject

   Call mailDb.OpenMail
   Set doc = mailDb.CreateDocument
   Call doc.ReplaceItemValue("Form", "Memo")
   Set body = doc.CreateRichTextItem("Body")
   Set style = session.CreateRichTextStyle
   Set color = session.CreateColorObject
   Call body.AppendText("This is some text before the section")
   Call body.AddNewline(2)
   Call body.BeginSection("Expanded Section", style, color, True)
   Call body.AppendText("Here is some text within the section")
   Call body.AddNewline(2)
   Call body.AppendText("Here is some more text within the section")
   Call body.EndSection
   Call body.AddNewline(2)
   Call body.AppendText("This is some text between the two sections")
   Call body.AddNewline(2)
   Call body.BeginSection("Collapsed Section")
   Call body.AppendText("Here is some text within the section")
   Call body.AddNewline(2)
   Call body.AppendText("Here is some more text within the section")
   Call body.EndSection
   Call body.AddNewline(2)
   Call body.AppendText("This is some text after the section")
   Call doc.Save(True, False, False)
   Call ws.EditDocument(True, doc)
   Call doc.Remove(True)
End Sub

为了完整起见,这里有一个教程如何从 xpage Tutorial-Introduction-to-XPages-Exercise-20调用 lotusscript 代理 希望它有所帮助。

编辑:只记得他们在笔记客户端中进行了关于 css 和 html的调查。

于 2012-07-22T07:47:18.667 回答
1

我认为你能做到这一点的唯一方法是使用 DXL。即,对包含所需样式的部分的文档进行 DXL 导出。编写代码以生成相同的 DXL,使用您需要自定义的任何内容(例如标题)进行修改,然后将其导入新文档。然后编写代码来打开这个新文档,读取包含该部分的富文本项目,并使用 AppendRTItem 将其放入您正在处理的文档中。

于 2012-07-18T15:41:43.150 回答