Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Lotus Notes and VFP
Message
 
 
To
26/11/2009 22:16:11
Paul Ong
Knights of Christ Foundation
California, United States
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Environment versions
Visual FoxPro:
VFP 8
OS:
Windows XP SP2
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01436703
Message ID:
01436705
Views:
60
You cannot automate Word unless Word is running.
You cannot automate Excel unless Excel is running.
You cannot automate Notes unless Notes is running.

See the pattern? :-)



>hi guys and gals,
>
>got this piece of code and honestly it does the trick, only to realize that the LN should be up and running. my ? is that, is there a way to automate lotus notes even if its not running? can someone help me point to the salvation road? thanks in advance
>
> LOCAL lcSubject , lcReceipient, lcBodyText, llSaveIt
> LOCAL loSession , loMailDB , loMailDoc
> LOCAL lcServer , lcMailFile , loRichText, loAttachment
>
> *-- Set Variaibls for mail
> lcSubject = "Test Notes Email from VFP"
> lcReceipient = "its-ra_saci.sm.ho@sm-shoemart.com"
> lcBodyText = "This is the main message of the Email"
> llSaveIt = .F.
>
> *--------------- Notes Automation ------------------
> loSession = CreateObject("Notes.NotesSession")
>
> lcServer = loSession.GetEnvironmentString("MailServer",.T.) && Causes Notes To Ask for Auth
> lcMailFile = loSession.GetEnvironmentString("MailFile",.T.) && Causes Notes To Ask for Auth
>
> *-- Open the mail database in notes
> loMailDB = loSession.GetDatabase(lcServer,lcMailFile)
>
> *-- If Mail Database not open, open it.
> IF !loMailDB.IsOpen
> loMail.OpenMail()
> ENDIF
>
> *-- Setup new Mail Document.
> loMailDoc = loMailDB.CreateDocument() && Causes Notes To Ask for Auth
> WITH loMailDoc
> .Form = "Memo"
> .SendTo = lcReceipient
> .Subject = lcSubject
> .Body = lcBodyText
> .SaveMessageOnSend = llSaveIt
>
> loRichText = .CreateRichTextItem("loAttachment")
> loAttachment = loRichText.EmbedObject(1454,"","c:\autoexec.bat")
>
> *-- Send the Document
> .PostedDate = DATE()
> .Send(0)
> ENDWITH
>
> loMailDoc = .NULL.
> loMailDB = .NULL.
> loSession = .NULL.
Previous
Reply
Map
View

Click here to load this message in the networking platform