Lotus Notes Question

dan_pafc

Board Regular
Joined
Aug 16, 2007
Messages
162
Hi I might be posting incorrectly but I know there are very knowledgable Lotus Notes users here!

I am looking to add a command into a stationary memo so that whenever I launch it the date automatically updates, like using the =today() function in excel.

Can anyone suggest how to do it?

Many Thanks - Dan.
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Hi I might be posting incorrectly but I know there are very knowledgable Lotus Notes users here!

I am looking to add a command into a stationary memo so that whenever I launch it the date automatically updates, like using the =today() function in excel.

Can anyone suggest how to do it?

Many Thanks - Dan.

Anyone?
 
Upvote 0
You could manipulate the Msg and just add VBA's Date function. Here's an Notes example from Ivan Moala:

Code:
Sub LotusNotes_Session()
    Dim Subject As String
    Dim Recipient As String
    Dim Msg As String
    Dim nSession As notesSession
    Dim nDatabase As NotesDatabase
    Dim nDoc As NOTESDOCUMENT
    'Need to reference the Lotusnotes object library
    
    Subject = "Test message from VBA"
    Recipient = "me@here.com.nz"
    Msg = "This is a message sent to myself from VBA." + _
    vbNewLine + "blah"
    
    'session and database declared in general as object
    Set nSession = CreateObject("Notes.NotesSession") 'create notes session
    Set nDatabase = nSession.GetDatabase("", "") 'set db to database not yet named
    Call nDatabase.OPENMAIL 'Open the users mail database
    
    Set nDoc = nDatabase.CREATEDOCUMENT 'create a new document in mail database
    Call nDoc.replaceitemvalue("SendTo", Recipient) 'create sendto field
    Call nDoc.replaceitemvalue("Subject", Subject) 'create subject field
    Call nDoc.replaceitemvalue("Body", Msg) 'create body field
    Call nDoc.SEND(False) 'send message
    
    Set nSession = Nothing ' close connection to free memory

End Sub

'Notes from help file;
    'Set nDatabase = nSession.GetDatabase( server$, dbfile$ [, createonfail ] )

    'Parameters
    'server$
        'String. The name of the server on which the database resides.
        'Use an empty string ("") to indicate a database on the current computer:
        'if the script runs on the workstation, the empty string indicates a local database;
        'if the script runs on a server, it indicates a database on that server.
    
    'dbfile$
        'String. The file name and location of the database within the Notes data directory.
        'Use empty strings for both dbfile$ and server$ if you want to open the database later.
        'Use a full path name if the database is not within the Notes data directory.
    
    'createonfail
        'Note This parameter is new with Release 5.
        'Boolean. Optional. Specify True (default) to create the database if it does not exist.
    
    
    'Return value
        'NotesDatabase
        'A NotesDatabase object that can be used to access the database you've specified.
        'If a database exists at the server$ and dbfile$ specified,
        'the NotesDatabase object is open, and the script can access all its properties and methods.
        'If a database does not exist at the server$ and dbfile$ specified,
        'the NotesDatabase object is closed. To create a new database at the
        'specified location if one does not exist, specify True for createonfail.
    
'Ivan F Moala

HTH,
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,431
Messages
6,124,855
Members
449,194
Latest member
HellScout

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top