通过 Lotus 脚本将字段中的每个值分隔为换行符
我有这个函数..并且我想每次在添加 mWrkFlwDoc.workFlow(0)
Function workFlowHistory() 之前向 mVal 添加新行 workFlowHistory=False
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
End Function
我读到了有关 AddNewLine 方法的信息,但它在富文本项中插入新行......我如何使用字符串数据类型、文本字段来处理它?
i have this piece of function..and i want to add a new line to mVal every time before adding mWrkFlwDoc.workFlow(0)
Function workFlowHistory()
workFlowHistory=False
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
End Function
i read about AddNewLine method but it inserts new lines in a rich text item....how can i go about it with string datatype, text field?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
此处可以使用多值字段。为此,您需要创建一个数组并将每个新条目放入循环内的数组中。可以将表单上的字段设置为在新行上显示每个值。
如果您不想使用多值字段,只需为每个新行添加 Chr(13) 即可。
A multi-value field can be used here. To do that you need to create an array and put each new entry in the array, inside the loop. The field(s) on the form can be set to show each value on a new line.
If you do not want to use a multi value field, just add a Chr(13) for each new line.