Print Email In Hardcopy using Lotusscript

Hi all, I am currently facing a problem of printing an email using lotus script. Below is the code:

Dim db As NotesDatabase

Dim s As New NotesSession

Dim doc1 As NotesDocument

Dim ws As New NotesUIWorkspace

Dim uidoc As NotesUIDocument

Dim rtitem As NotesRichTextItem

Dim richs As NotesRichTextStyle

Set db = s.CurrentDatabase

Set uidoc = ws.CurrentDocument

Set doc1 = New NotesDocument( db )

Set richs = s.CreateRichTextStyle

Set rtitem = New NotesRichTextItem( doc1, “Body” )

Dim additionaltext As String

additionaltext= uidoc.FieldGetText(“addnote”)

Call rtitem.AppendText(additionaltext)

doc1.Subject = “Sample”

doc1.SendTo = empnoteID

Call doc1.print

Call doc1.Save(False, True)

Problem: Everything works fine without “Call doc1.print” . The error message prompted is “Illegal use of PROPERTY”. Anyone has the idea of printing out the email that is going to be sent out to receiver?

Thank you in advanced! :slight_smile:

Subject: print is not a notesdocument method

you cannot print a notesdocument, you can only print notesUIdocument (a shame, I know)