Mapi with Lotus Notes in VB.NET

  • Thread starter Thread starter Kani
  • Start date Start date
K

Kani

Hi,

I am trying to use MAPI with Lotus Notes Client. (I have to use MAPI).
I have a MapiFile Object as folows.

Dim mFile(0) As MapiFile
With mFile(0)
.lpszPathName = "C:\test.txt"
.lpszFileName = "C:\test.txt"
.nPosition = 0
.flFlags = 0
.lpFileType = 0
End With

And mapiMessage.nFileCount = 1
mapimessage.lpFiles = mFile

Public Declare Auto Function MapiSendMail Lib "Mapi32.dll" Alias
"MAPISendMail" _
(ByVal pSession As Integer, _
ByVal pUIParam As Integer, _
ByRef pMsg As MapiMessage, _
ByVal pFlags As Integer, _
ByVal pReserved As Integer) As Integer

MapiSendMail(0, 0, msg, 0, 0)

I tried another way also. I included MapiFile in MapiSendMail function
as follows.

Public Declare Auto Function MapiSendMail Lib "Mapi32.dll" Alias
"MAPISendMail" _
(ByVal pSession As Integer, _
ByVal pUIParam As Integer, _
ByRef pMsg As MapiMessage, _
ByRef pFile As MapiFile, _
ByVal pFlags As Integer, _
ByVal pReserved As Integer) As Integer

And tried
MapiSendMail(0, 0, msg, mfile(0), 0, 0)

Both methods open a new message in Lotus Notes, but the attachments
are missing. Subject and body text are coming fine. I am programming
in VB.NET and I am not able to figure out what I am doing wrong.

Any help would greatly be appreciated.

Thank you
Kani
 
Back
Top