通过lotus脚本将每个值分隔为字段中的换行符

时间:2012-01-24 06:13:56

标签: lotusscript

我有这个功能..我想在添加 mWrkFlwDoc.workFlow(0)

之前每次向mVal添加一个新行

功能workFlowHistory()     workFlowHistory =假

Dim mWrkFlwVw As NotesView
Dim mWrkFlwColl As NotesDocumentCollection
Dim mWrkFlwDoc As NotesDocument
Dim mVal As String

Set mWrkFlwVw = gDB.GetView("lkpWorkFlow")
Set mWrkFlwColl = mWrkFlwVw.GetAllDocumentsByKey(gDoc.empName(0),True)
Set mWrkFlwDoc = mWrkFlwColl.GetFirstDocument

mVal = ""

Do While Not mWrkFlwDoc Is Nothing
    If mWrkFlwDoc.documentID(0) = gDoc.documentID(0) Then
        ***mVal =mVal+ mWrkFlwDoc.workFlow(0)*** ' add new line before adding mWrkFlwDoc.workFlow(0)

    End If
    Set mWrkFlwDoc = mWrkFlwColl.GetNextDocument(mWrkFlwDoc)
Loop
gDoc.workFlowHistory = mVal
gDoc.save True,True
workFlowHistory=True

结束功能

我读到了AddNewLine方法,但是它在富文本项中插入新行....我怎样才能使用字符串数据类型,文本字段?

1 个答案:

答案 0 :(得分:4)

此处可以使用多值字段。要做到这一点,你需要创建一个数组并将每个新条目放在循环内的数组中。可以将表单上的字段设置为在新行上显示每个值。

如果您不想使用多值字段,只需为每个新行添加一个Chr(13)。