Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Lotus notes email with secured database

Status
Not open for further replies.

teriwinkle

Technical User
Oct 29, 2003
7
US
Hello,

I have a cmdButton to email a report. HOwever, I have the database secured with the users who would need to email the reports as "new data" and "update data" users. Apparently only users with full permissions can currently send the email becasue of the CreateObject command. The error occurs at this point in the code below:

Set notessession = CreateObject("Notes.Notessession")



Here is the code for my lotus notes email button:

______________________________________________

Private Sub cmdEmail_Click()


Set MyDatabase = CurrentDb()
Dim mFormName As String
Dim MyQueryDef As DAO.QueryDef
Dim notesdb As Object
Dim notesdoc As Object
Dim notesrtf As Object
Dim notessession As Object
Dim NVRJob As Object
Dim strChemist As Object
Dim strPass As Object
Dim strToWhom As Object
Dim strSubject As String



mFormName = "frm_NVR_sub"
strSubject = "Job" & " " & Me!JobNo & " " & "NvrReport"

Set NVRJob = Me![JobNo]
Set strChemist = Me![Chemist]
Set notessession = CreateObject("Notes.Notessession")
Set notesdb = notessession.GetDatabase("", "")
Call notesdb.OPENMAIL
Rem make new mail message
Set notesdoc = notesdb.CreateDocument
Call notesdoc.REPLACEITEMVALUE("Sendto", "tlR@myemail.com")
'Call notesdoc.REPLACEITEMVALUECall notesdoc.REPLACEITEMVALUE("Subject", strSubject)
Set notesrtf = notesdoc.CreateRichTextItem("body")
Call notesrtf.AppendText("The NVR testing is complete for Job # ")
Call notesrtf.AppendText("The NVR testing is complete for", NVRJob)
Call notesrtf.AddNewLine(2)
Call notesrtf.AppendText(strChemist)
Call notesrtf.AddNewLine(2)
Call notesrtf.EmbedObject(1454, "", "C\PCL_CUSTOMERS\pcldata\rptNvr\NVRReport.rtf")
notesdoc.SAVEMESSAGEONSEND = True '(this code works for saving a message in the Sent folder)
notesdoc.Visible = True
Call notesdoc.Save(True, False)


Rem attach Error Report doc
's = ActiveDocument.Path + "\" + ActiveDocument.Name
' Call notesrtf.EmbedObject(1454, "", strCurrentPath, "Mail.rtf")
Rem send message
Call notesdoc.Send(False)
Set notessession = Nothing
End Sub

_____________________________________________-

Is there away around this without giving the users full permissions?

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top