Lotus Notes/Lotus Designer

Lotus Script - DB 양식에 쓰기

지병철 2013. 9. 27. 14:06

Sub WriteNewDocument(sendto As Variant, subject As String, appdoc As NotesDocument)

On Error GoTo errHandle

Dim targetdb As NotesDatabase

Dim newDoc As NotesDocument

Dim item As NotesItem

Set targetdb = ss.Getdatabase(Server Name, Db Name)


If Not targetdb.IsOpen Then

Call targetdb.Open("","")

End If

Set newDoc = targetdb.Createdocument

newDoc.Form = "PBoard"

newDoc.Subject = subject

newDoc.Categories = "공지사항"

newDoc.회의록저장소 = "공용게시판"

newDoc.sendto = sendto

Set item = appdoc.getfirstitem("contents")

Call newDoc.Copyitem(item, "Body")

Dim memo As NotesDocument

Dim rtitem As NotesRichTextItem

Set memo = New NotesDocument(targetdb)

memo.Form = "Memo"

Set rtitem = New NotesRichTextItem(memo, "Body")

Call rtitem.appendtext("[" + newDoc.회의록저장소(0) + "] " + newDoc.Subject(0) + " 공지사항입니다. ==> ")

Call rtitem.appenddoclink(newDoc, "공용게시판 공지사항")

memo.sendto = sendto

memo.subject = subject


Call newDoc.Save(True,False)


Call memo.send ( False )

skip:

Exit Sub

errHandle:

Print "agent메일발송계획 error"

Resume skip

End Sub



'Lotus Notes > Lotus Designer' 카테고리의 다른 글

Lotus Script 로 Collection 이용하기  (0) 2013.11.21
@DbColumn, @DbLookup  (0) 2013.11.21
Lotus Domino ODBC 연결  (0) 2013.11.05
Lotus Script - explode  (0) 2013.09.27
Lotus Script 텍스트 파일을 읽어서 처리하는 로직  (0) 2013.09.26