Subject: RE: Problem with .NET Application with domobj.
Ok, below the example code, is only to send a mail via Notes.
*** Begin code ***
'This is the declarations:
Global nsess As New NotesSession
Global ndbd As NotesDbDirectory
Global ndb As NotesDatabase
Global ndoc As NotesDocument
Global nrtitem As NotesRichTextItem
Global nembed As NotesEmbeddedObject
'This is the code, I simply send a mail (this is a sample):
On Error Resume Next
nsess.Initialize
On Error GoTo 0
Set ndbd = nsess.GetDbDirectory(nsess.ServerName)
Set ndb = ndbd.OpenMailDatabase
Set ndoc = ndb.CreateDocument
ndoc.ReplaceItemValue “Form”, “Memo”
ndoc.ReplaceItemValue “SendTo”, “test@test.com”
ndoc.ReplaceItemValue “CopyTo”, “”
ndoc.ReplaceItemValue “BlindCopyTo”, “”
ndoc.ReplaceItemValue “Subject”, “TEST.”
data01 = Format(Now, “MM/DD/YYYY HH:MM:SS”)
ndoc.ReplaceItemValue “PostedDate”, data01
Set nrtitem = ndoc.CreateRichTextItem(“Body”)
nrtitem.AppendText Trim$(“HELLO”)
nrtitem.AddNewLine
nrtitem.AppendText “”
nrtitem.AddNewLine
Set nembed = nrtitem.EmbedObject(EMBED_ATTACHMENT, “”, c.\filetest.txt)
ndoc.Save False, False
ndoc.Send False
*** End code ***
Thank you very much.