18.01.2013 Views

LotusScript for Visual Basic Programmers - IBM Redbooks

LotusScript for Visual Basic Programmers - IBM Redbooks

LotusScript for Visual Basic Programmers - IBM Redbooks

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Mail Enabling<br />

CreateObject, GetObject<br />

One advantage <strong>for</strong> both language dialects is that external OLE servers can<br />

be added into your applications using these statements. This exposes the<br />

full power of OLE automation servers, like Word Pro and Notes, to<br />

applications written in BASIC.<br />

Fortunately, the ability to create and send e-mail is fairly easy in both<br />

<strong>LotusScript</strong> and <strong>Visual</strong> <strong>Basic</strong>.<br />

In <strong>LotusScript</strong>, to send a message in Notes requires the following type of<br />

code:<br />

Sub Click (source as Button)' a button to send info with...<br />

dim session as new NotesSession<br />

dim db as NotesDataBase<br />

dim doc as NotesDocument<br />

set db = session.currentDatabase<br />

set doc = new NotesDocument (db)<br />

doc.Form = "Memo"<br />

if txtSubject = "" then<br />

else<br />

endif<br />

doc.Subject = "Here is a quick thought ..."<br />

doc.Subject = txtSubject.text<br />

if txtMemo = "" then<br />

else<br />

endif<br />

doc.Memo = "Example Text"<br />

doc.Memo = txtMemo.text<br />

Call doc.Send (False, "Shadish")<br />

End Sub<br />

26 <strong>LotusScript</strong> <strong>for</strong> <strong>Visual</strong> <strong>Basic</strong> <strong>Programmers</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!