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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using ShellExecute with an attchment and sending it to Lotus Notes R5

Status
Not open for further replies.

uwec89

Programmer
Nov 8, 2002
2
US
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top