LotusScript 代理的基本用法

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

LotusScript 代理的基本用法

1、FTSearch搜索:

Set dc=db.Ftsearch("name",0)

'0位置为最大的查询数,0为所有匹配的文件FTSearch必须创建数据库索引Set doc=dc.Getfirstdocument()、

2、Item:

Set doc=dc.Getfirstdocument()

While Not doc Is Nothing

ForAll ritem In doc.Items

MsgBox

End ForAll

Wend

3、取出特定的域

Set doc=view.getFirstdocument()

If doc.HashItem("yu") <> "" Then

Set item=doc.getfirstitem("yu")

Set doc=view.getNextdocument(doc)

End If

4、使用文本属性

If doc.Hashitem("yu") <> "" Then

Set doc=dc.Getfirstdocument()

While Not doc Is Nothing

ForAll itemValue In doc.yu

itemValue = "Anonymous"

End ForAll

Set doc=dc.Getnextdocument(doc)

Wend

End If

5、获取域值:

ForAll itemValue In doc.Getitemvalue("yu")

6、添加域

set item =new NotesItem(doc,"newYu",erName)

Call doc.Appenditemvalue("newYu",Newvalue)

7、替换值:

1)、While Not doc Is Nothing

Call doc.Replaceitemvalue("resName","newValue")

Set doc=dc.getnextdocument(doc)

Wend

2)、Set doc=dc.Getfirstdocument()

While Not doc Is Nothing

'Call doc.Replaceitemvalue("resName","newValue")

Set item =doc.Getfirstitem("yu")

While Not item Is Nothing

ForAll resitems In doc.Itemsv(0)

resitems="newVlaue"

End ForAll

= doc.Itemsv(0)

Set item =doc.getnextitem(item)

Wend

Set doc=dc.getnextdocument(doc)

Wend

8、拷贝域

Set item =doc.Getitemvalue("name")

call item.Copyitemtodocument(doc, "name")

call doc.save(true,false)

Call doc1.Copyallitems(doc2,true) ‘替换所有的9、删除指定的域:

1)、For j=1 To dc.count

Set item=doc.Getitemvalue("name")

While Not item Is Nothing

Call item.Remove()

Call doc.Save(true,false)

Wend

Set doc=dc.Getnthdocument(j)

Next

2)、For j=1 To dc.count

While Not doc.Hasitem("name")

Call doc.Removeitem("name")

Call doc.Save(True,false)

Wend

Set doc=dc.Getnthdocument(j)

Next

10、RTF文本域的输出:

Set item=doc.GetFirstItem("RtfYU")

MsgBox item.Text

11、在代理中使用公式:

temp=Evaluate("@ReplaceSubstring(aa;bb;cc)",doc) 12、嵌入对象:

ForAll csx In doc.Embeddedobjects

End ForAll

Set doc=dc.Getnthdocument(j)

Next

13、激活嵌入对象:

Call doc.EmbeddedObjects(0).Activate(True)

14、if的用法

Set doc=dc.Getfirstdocument() If Not IsEmpty(db.Agents) Then ForAll agent In db.Agents MsgBox

End ForAll

End If

相关文档
最新文档