![](http://www.ibm.com/i/c.gif)
Document #: 1207011000000
Body:
[标题]
为什么用Lotus Script给读者域或作者域赋值却不起作用?
环境:(产品,平台,机型,软件版本,等)
产品:Lotus Domino/Notes
平台:Cross Platform
问题描述:
在 Lotus Script 中,通常情况下,我们用以下方法给一个域 赋值,例如给下面的“ Body ” 域 赋值 "Client meeting postponed." :
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Set db = session.CurrentDatabase
Set doc = New NotesDocument ( db )
doc.Form = "Status"
doc.Body = "Client meeting postponed."
Call doc.Save( True, True )
如果某个域是 读者域或作者域 ,则您会发现上面的 赋值 并没有起到 读者域或作者域 的作用。这时您应该采用以下两种方法:
解答:
- 1. 在保存文档之前对当前域使用IsReader 属性(在NotesItem中定义) 来设置。下面的例子将“People”域设置为读者域。
Dim doc As NotesDocument
Dim item as NotesItem
'...set value of doc...
Set Item = doc.GetFirstItem("People")
item.IsReaders = True
Call doc.Save( False, True )
- Dim doc As NotesDocument
'...set value of doc...
Dim newValues( 1 To 2 ) As String
newValues( 1 ) = "CN=Mariko Nakamura/OU=Sales/O=Widgets"
newValues( 2 ) = "CN=Pierre Singer/OU=Sales/O=Widgets"
Dim authorsItem As New NotesItem(doc, "docAuthors", newValues, AUTHORS)
Call doc.Save( True, True )