We have a VB program that needs to do the following:
1. Open a new email memo in Lotus Notes R5
2. Add a subject to the email
3. Attach a file to the email.
I can get the new memo to open with the subject line, but I cannot get the attachment part to work.
Is this possible with Lotus Notes and ShellExecute?
We cannot send the email and attachment behind the scenes (CDO/MAPI), because the users need to enter the email addresses after the new email memo opens.
Any help would be appreciated!
Here is what we have so far:
Public Sub SendFNOLRptEmail(ByVal sMailSubject As String, _
ByVal sFileAndPath As String)
On Error GoTo ErrorHandler
Const cmMethodName = "SendFNOLRptEmail"
Dim sCommand As String
Dim Hwnd As Long
'Compose the parameters.
'Add the mailto command.
sCommand = "mailto:"
'Add the subject
sCommand = sCommand & "?Subject=" & sMailSubject
'Add the report as an attachment
sCommand = sCommand & "&Attach=" & Chr(34) & sFileAndPath & Chr(34)
'Send this to ShellExecute.
Hwnd = GetCurrentProcessId
ShellExecute Hwnd, "open", sCommand, vbNullString, vbNullString, vbNormalFocus
Exit Sub
ErrorHandler:
Err.Raise Err.Number, Err.Source, Err.Description, Err.HelpFile, Err.HelpContext
End Sub
1. Open a new email memo in Lotus Notes R5
2. Add a subject to the email
3. Attach a file to the email.
I can get the new memo to open with the subject line, but I cannot get the attachment part to work.
Is this possible with Lotus Notes and ShellExecute?
We cannot send the email and attachment behind the scenes (CDO/MAPI), because the users need to enter the email addresses after the new email memo opens.
Any help would be appreciated!
Here is what we have so far:
Public Sub SendFNOLRptEmail(ByVal sMailSubject As String, _
ByVal sFileAndPath As String)
On Error GoTo ErrorHandler
Const cmMethodName = "SendFNOLRptEmail"
Dim sCommand As String
Dim Hwnd As Long
'Compose the parameters.
'Add the mailto command.
sCommand = "mailto:"
'Add the subject
sCommand = sCommand & "?Subject=" & sMailSubject
'Add the report as an attachment
sCommand = sCommand & "&Attach=" & Chr(34) & sFileAndPath & Chr(34)
'Send this to ShellExecute.
Hwnd = GetCurrentProcessId
ShellExecute Hwnd, "open", sCommand, vbNullString, vbNullString, vbNormalFocus
Exit Sub
ErrorHandler:
Err.Raise Err.Number, Err.Source, Err.Description, Err.HelpFile, Err.HelpContext
End Sub