Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Execute Lotus Notes @Commands in VB?

Posted on 1999-07-02
4
Medium Priority
?
689 Views
Last Modified: 2008-03-06
Is it possible to execute Lotus @commands in Visual Basic 6?
0
Comment
Question by:deljones
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1521458
'Email the information to the selected contact person.  This uses the existing lotus notes client of the users PC.  If they are not logged in at the time they try to send the email, they will be prompted by Lotus Notes.  In the project references, you must also check "Lotus Notes Automation Classes".  

Private Sub Send_Mail()

    Dim Resp As Integer
    Dim Server As String
    Dim UserDef As String
    Dim DefFile As String
    Dim NOTESSESSION As Object
    Dim NOTESDATABASE As Object
    Dim NOTESDOCUMENT As Object
    Dim NotesRichText As Object
     
    'Each person will have to have a different user definition file to access their Lotus Notes email.
    'This is kept in a text file for easier change and update.
    DefFile = App.Path + "\userdef.txt"
    Open DefFile For Input As #1
         Input #1, Server, UserDef
    Close #1
     
    'This is an example of what the definitions need to look like.  The Server, and users nsf file will be site specific.
    'Server = "SERVER_NAME/Path"
    'UserDef = "MAIL\jmartin.nsf"
     
     
     
            'Here is where we tag into the Lotus Notes email system to send the email.
            Set NOTESSESSION = CreateObject("Notes.NotesSession")
            Set NOTESDATABASE = NOTESSESSION.GETDATABASE(Server, UserDef)
            'This is an example of what this looks like without the variables.
            'Set NotesDatabase = NotesSession.GetDatabase("MY_SERVER_NAME/Sub Directory", "MAIL\jmartin.nsf")
            Set NOTESDOCUMENT = NOTESDATABASE.CREATEDOCUMENT
            Set NotesRichText = NOTESDOCUMENT.CREATERICHTEXTITEM("Body")

            NOTESDOCUMENT.Subject = txtSubject.Text 'This is the subject of the email an appears in the subject line
            NOTESDOCUMENT.Body = txtMessage.Text   'This is the actual message of the email
            NOTESDOCUMENT.SendTo = Email(lstNames.ListIndex)    'Here is the email address of the person your emailing to.
            NOTESDOCUMENT.SAVEMESSAGEONSEND = False 'This has to be set to False or we get errors
            NOTESDOCUMENT.SEND False    'Keep this set to false.
        End If
    End If
     
End Sub

0
 

Author Comment

by:deljones
ID: 1521459
This code uses Lotus notes methods, which I can already do.  I need to find out if it's possible to execute an @Command via VB.  

Ie. in notes the command would be:
'@command([CreateTextBox])'.
0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1521460
Sorry, I don't know
0
 
LVL 1

Accepted Solution

by:
poneill011098 earned 200 total points
ID: 1521461
Notes v4.x does not support the use of @ commands - you need to find the corresponding NotesScript command.

Don't know about v5.x

0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

664 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question