I was hoping someone could explain exactly what is happening here with this procedure.
I changed out the
Set objSession = CreateObject("Notes.NOTESSESSION")
with
DoCmd.SendObject acSendNoObject, , , , , , "Clarification for PO", "Please Clarify reason for PO:", , True
And I deleted:
strServer = objSession.GETENVIRONMENTSTRING("mailserver", True)
strMailFile = objSession.GETENVIRONMENTSTRING("mailfile", True)
Set mobjDB = objSession.GETDATABASE(strServer, strMailFile)
but for some reason my form is not updating after sending the email.
Code:
Public Function OPEN_SESSION() As Boolean
Dim objSession As Object
Dim strServer As String
Dim strMailFile As String
'Outlook must be open for module to work correctly
If MsgBox("Do you have Outlook running?", vbCritical + vbYesNo, "Warning!") = vbYes Then
'this code must be left out of the loop so that only one session is started
Set objSession = CreateObject("Notes.NOTESSESSION")
strServer = objSession.GETENVIRONMENTSTRING("mailserver", True)
strMailFile = objSession.GETENVIRONMENTSTRING("mailfile", True)
Set mobjDB = objSession.GETDATABASE(strServer, strMailFile)
OPEN_SESSION = True
Else
MsgBox "Please start Outlook and try again.", vbOKOnly, "Emails"
OPEN_SESSION = False
End If
End Function
I changed out the
Set objSession = CreateObject("Notes.NOTESSESSION")
with
DoCmd.SendObject acSendNoObject, , , , , , "Clarification for PO", "Please Clarify reason for PO:", , True
And I deleted:
strServer = objSession.GETENVIRONMENTSTRING("mailserver", True)
strMailFile = objSession.GETENVIRONMENTSTRING("mailfile", True)
Set mobjDB = objSession.GETDATABASE(strServer, strMailFile)
but for some reason my form is not updating after sending the email.