This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal


Mar 11, 2014, 9:47 AM
21 Posts

Generate Email Using Lotus Script and Open in MS Outlook

  • Category: Application Development
  • Platform: Windows
  • Release: 9.0.1
  • Role: Developer
  • Tags:
  • Replies: 1

Hi all,

The possibility of moving from Notes email to Outlook email is gathering momentum here.
This will obviously be a substantial project as and when it goes ahead.

One question I have ......

We have some Lotus Script functions which generate emails from Notes documents and then open up the email in users mail file, so it can be checked and addressed accordingly. Sending the emails automatically from Notes database is not a requirement with this.

If we were to go to Outlook, this kind of functionality will need to be transferred.

Hence, my question is ... is there some way to do this and open the programmatically generated email in Outlook mail file .. ?

Using VBA perhaps and passing parameters .. ? 


Any help or advice will be greatly appreciatred.
Many thanks.

May 14, 2014, 9:39 AM
21 Posts
Found some samples in R6 forum .....

Hi all,
Did some digging in R6 forum and found some great samples for what I want to achieve.
My basic routine is below .... works a treat.
Had issue as detailed by others with the .Display aspect. But many thanks to Edward W Cornies for his workaround, back in 2006 ..!! 
Plan to do more research and testing on this but a great start. 
Cheers
Andy

Sub Initialize
Dim s As New NotesSession
Dim ws As New NotesUIWorkspace  

Set db = s.CurrentDatabase
Dim dc As NotesDocumentCollection
Set dc = db.UnProcessedDocuments 

Print "Opening instance of MS Outlook"
Set OutlookApp = CreateObject ( "Outlook.Application" )

If IsObject ( OutlookApp ) Then
    Set myItem = OutlookApp.CreateItem (0)
   
With myItem
        .to = "TO FIELD POPULATED"
        .cc = "CC FIELD POPULATED"
        .Subject = "SUBJECT FIELD POPULATED"

        Set curdoc = dc.GetFirstDocument 
        For x = 1 To dc.Count

           
.body = curdoc.Airline (0).
            .
body = .body & Chr (10) & curdoc.Make (0)
           
.body = .body & Chr (10) & curdoc.Model (0

            Set curdoc = dc.GetNextDocument ( curdoc )
        Next

' Display Mail to user
        On Error Resume Next
        
.Display
        If Err <> 0 Then 
            If Err <> 207 Then
                MessageBox ( "An Error has occurred # :" & Err )
            End If
        End If

    End with
End if

End Sub


This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal