Microsoft
Software
Hardware
Network
Question : Accessing Notes Items in Domino with VB.NET
After the "doc = dbNotes.CreateDocument" line doc looks OK except items is Nothing.
After the line "item = doc.GetFirstItem("Invoice_
Number") " item is Nothing, which goes along with the previous.
How do I associate the doc variable with the form "Document" which is in the dbNotes database? The form "Docuemnt" contains the fields/items that I am trying to populate.
I am using VS2005, VB.NET, and the Interop.Domino library, which doesn't seem to have a UIDocument.
**************************
**********
**********
**********
**********
**********
**********
*********
' Setup Notes database access
Dim NotesSession As New NotesSession
Dim dbNotes As NotesDatabase
Dim doc As NotesDocument
Dim item As NotesItem
Dim strArray As String()
Dim I As Int32
Dim Field As String
frmMergeIC.sbMerge.Text = "Moving image to Notes"
' Add the image
Try
NotesSession.Initialize(""
)
dbNotes = NotesSession.GetDatabase(N
otesServer
, NotesDatabase)
doc = dbNotes.CreateDocument
' Update the Invoice Number
item = doc.GetFirstItem("Invoice_
Number")
strArray = Split(invnum, "*")
For I = 0 To UBound(strArray)
Field = strArray(I)
If Field <> "" Then Call item.AppendToTextList(Fiel
d)
Next I
Answer : Accessing Notes Items in Domino with VB.NET
That is because a new document does not have any items. You need to create the item first using ReplaceItemValue.
instead of ...
item = doc.GetFirstItem("Invoice_
Number")
... try using ...
item = doc.ReplaceItemValue("Invo
ice_Number
", "")
Random Solutions
Loop through each table, then Find & Replace
Add preset percentile counts to SQL SP
Access Runtime Edition - Opens db's in exclusive mode
How can I return an error message when a field or control is Blank
Adding new button to windows taskbar
Using a geometry type check constrint in sql sever 2008
extraction of objects from a sharepoint content database
Receiving multiple EVENT ID: 1053 on Windows 2003 Server, why?
IIS 6.0, SSL Renew, 2048 bit key lenth
Convert binary data to string to displayable text for user