Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Reading Lotus Notes DB?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01008683
Message ID:
01008827
Vues:
17
The reason I asked is that I have code (and most of my knowledge on this subject is based on) accessing the e-mail and address databases. Otherwise, I definitely have to refer you to the documentation I mentioned. I do know that it is possible to access the Domino databases (outside the e-mail).

The following code accesses the e-mail database of the logged in user, builds an e-mail document, attaches a file, and sends it. For an information database (non-email), I believe it would be similar but you will need to know individual field names and be prepared for hours of playing in the command window. It took me a few days to get this code to this point.
loNotesSession = CREATEOBJECT("Lotus.NotesSession") && Lotus accesses the Domino objects, Notes instead would access the UI
lsEndString = "You can reply to this message, if necessary."

TRY	
     THIS.m_oNotesSession.Initialize("mypass")

	CATCH TO loException WHEN loException.ErrorNo = 1429 AND;
			"Wrong Password" $ loException.Message

			THIS.Message1 = "Invalid Lotus Notes password. E-mail terminated."
			lblnError = TRUE

	CATCH TO loException WHEN loException.ErrorNo = 1429 AND;	&& Catch to ignore
		"Session" $ loException.Message AND;
		"already" $ loException.Message AND;
		"initialized" $ loException.Message

	CATCH TO loException
		DO ErrorReport.prg WITH AERROR(gaError), loException.LineContents,;
				loException.Procedure, loException.LineNo
	ENDTRY

	IF lblnError
		RETURN FALSE

	ENDIF

	lsEndString = "This is an unmonitored account."

ENDIF

&& Don't bother if there's no one to send it to.
IF !ISNULL(laSendErrorList[1])
	WITH THIS.m_oNotesSession
		lsMailServer = .GetEnvironmentString("MailServer", TRUE)  && obtains name of Domino server
		lsMailDB = .GetEnvironmentString("MailFile", TRUE)  && obtains users Mail DB

		loDB = .GetDatabase(lsMailServer, lsMailDB)  && sort of like USE

	ENDWITH	&&THIS.m_oNotesSession

	loDoc = loDB.CreateDocument()  && Notes DBs are document based not field or record. 
	loDoc.ReplaceItemValue("Subject", "My Subject")

	DIMENSION laSendList[ALEN(THIS.m_aSendErrorList, ARRAY_ROW)]
	ACOPY(THIS.m_aSendErrorList, laSendList)

	loDoc.ReplaceItemValue("SendTo", @laSendList)  && Pass in Send list array, 
	loRTF = loDoc.CreateRichTextItem("Body")

	WITH loRTF
		.EmbedObject(1454, "", ALLTRIM(THIS.m_sErrorFilename)) && Embeds a file
		.AddNewLine(2, TRUE)

		.AppendText("***THIS IS AN AUTOMATED E-MAIL***")
		.AddNewLine(1, TRUE)
		.AppendText(lsEndString)

	ENDWITH	&&loRTF

	loDoc.SaveMessageOnSend = TRUE
	loDoc.Send(FALSE)
While this code is for the e-mail DBs, it may help you get started digging through the designer's docs. Anything to do with Notes is not easy and the documentation in 6.5 is still lacking (better than 6.2 though).

Sorry I couldn't help more..

Richard


>I personally do not use Lotus Notes (have seen it) and hope I do not have to use it. We are NOT using it for email, but rather to track project activity. I have asked if it is possible to read the contents entered into a Lotus Notes record and extract it out to be manipulated elsewhere. Anyway, definetely not using any email capability at all.
>
>>We use it here for its e-mail capabilities. I suggest loading the client and the Domino Designer development package so you can look at the docs on the Domino objects. These objects allow you to use the Domino database without having the client UI completely loaded. The Lotus objects require that the user have already opened the Lotus Notes UI and logged in.
>>
>>Are you using for something other than e-mails?
>>
>>
>>Richard
>>
>>
>>
>>
>>>I am not there yet, but soon I will be asked to use Visual FoxPro 9 to connec to Lotus Notes and extract some information from that product.
>>>
>>>Has anyone connected to Lotus Notes using VFP? If so, can you provide some insights on how to approach this along with some code samples?
State of Florida, DCF
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform