2018年5月18日 星期五

[AP] Function AddString()


xdoc.Log_EH= AddString(xdoc, "執行Agent[.資料修正\彈性假異動] " + Server_Time() +" by "+s.UserNameList(0).Abbreviated, "Log_EH")


Function AddString(doc As NotesDocument, strContent As String, itemName As String) As Variant
REM This program append the strContent into Field as the next attrib with Name as itemName
 Dim i As Integer, ub As Integer
 Dim NIT As NotesItem
 ub = Ubound(doc.GetItemValue(itemName))
 Redim tmp(ub+1) As String
 If Ubound(doc.GetItemValue(itemName))=0 And doc.GetItemValue(itemName)(0)= "" Then
  ub = ub - 1
 End If
 For i = 0 To ub
  tmp(i)=doc.GetItemValue(itemName)(i)
 Next
 i = ub +1
 tmp(i) = strContent
 Set NIT = doc.ReplaceItemValue( itemName, Fulltrim(tmp) )
 AddString = Fulltrim(tmp)
End Function

沒有留言:

張貼留言