Princeinal Suganthi
asked on
creating a Notes document and notes item
Hi, I just tried a very simple code to create a document and to create a new item. Document gets created but not the new item.Below is the code:
Sub Initialize
Dim Session As New NotesSession
Dim db As NotesDatabase
Dim doc1 As NotesDocument
Dim item As NotesItem
Set db = session.Currentdatabase
Set doc1 = New NotesDocument(db)
Set item = New NotesItem _
(doc1, "ModifiedBy", session.UserName)
Call doc1.save(True, True)
End Sub
New-Document.jpg
Sub Initialize
Dim Session As New NotesSession
Dim db As NotesDatabase
Dim doc1 As NotesDocument
Dim item As NotesItem
Set db = session.Currentdatabase
Set doc1 = New NotesDocument(db)
Set item = New NotesItem _
(doc1, "ModifiedBy", session.UserName)
Call doc1.save(True, True)
End Sub
New-Document.jpg
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you Francois Koutchouk and Sjef Bosman.
Yes I didn't know that the field should already exist to copy value to it.
I am new to Lotus Notes. Now my issue is solved.
Yes I didn't know that the field should already exist to copy value to it.
I am new to Lotus Notes. Now my issue is solved.
Sorry, but I don't understand your last comment. Depending on where you have your code, there is no need that a field exists before you "copy a value to it". Can you show us the code that works for you? Thanks.
Call doc1.ReplaceItemValue("For