473,385 Members | 1,615 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

MSMAPI32 and Outlook

I've developed an application that uses the MSMAPI32 OCX to send an e-mail through the default e-mail client application

Here is the code

----------------------

axMAPISession1.SignOn()
axMAPIMessages1.SessionID = axMAPISession1.SessionID
axMAPIMessages1.Compose()
axMAPIMessages1.AttachmentPathName = attachfilename
axMAPIMessages1.Send(true)
axMAPISession1.SignOff()

----------------------

Everything works perfectly with Outlook Express (and Netscape Mail), while with Outlook I get the following error message

----------------------

************** Exception Text *************
System.Runtime.InteropServices.COMException (0x800A7D02): Unspecifie
Failure has occurre
at MSMAPI.IMapiMessages.Send(Object vDialog
at AxMSMAPI.AxMAPIMessages.Send(Object vDialog
at MyCalc.Form1.SendReportByMail(
at MyCalc.Form1.btMail_Click(Object sender
EventArgs e
at System.Windows.Forms.Control.OnClick(EventArgs e
at System.Windows.Forms.Button.OnClick(EventArgs e
at System.Windows.Forms.Button.OnMouseUp(MouseEventAr gs mevent
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButton
button, Int32 clicks
at System.Windows.Forms.Control.WndProc(Message& m
at System.Windows.Forms.ButtonBase.WndProc(Message& m
at System.Windows.Forms.Button.WndProc(Message& m
at System.Windows.Forms.ControlNativeWindow.OnMessage (Message& m
at System.Windows.Forms.ControlNativeWindow.WndProc(M essage& m
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg
IntPtr wparam, IntPtr lparam

----------------------

I've found out that the problem is given by the instruction that attaches a file to the e-mail message
axMAPIMessages1.AttachmentPathName = attachfilename

Can anybody help me

Thanks

Ma

Jul 21 '05 #1
0 2506

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Fritz Switzer | last post by:
Can anyone provide a small snippet in C# that pulls out the Contacts in Outlook XP. I've seen a couple of examples in C++ and VB in previous newsgroup posts, but either the originals didn't work...
10
by: John | last post by:
Hi When I open a new outlook email from vb.net, sometimes outlook is very slow to appear or occasionally outlook freezes completely. I am targeting mixed office2000/xp environments so I am...
9
by: Srinivas | last post by:
hi all how to access the outlook user profiles through VB.net any help.... thanks in advanc Srinivas
9
by: George McCullen | last post by:
I have an Outlook 2003 using Exchange Server 2003 Public Contacts Folder containing 20,000 Contacts. I am writing a VB .Net 2003 program that loops through all the contacts in a "for each oCt in...
3
by: John | last post by:
Hi I am trying to access outlook contacts folders and delete the contacts that do not contain a certain category value in the categories field. I have written the below code but am stuck with...
7
by: Chris Thunell | last post by:
I'm trying to loop through an exchange public folder contact list, get some information out of each item, and then put it into a vb.net datatable. I run though the code and all works fine until i...
0
by: MaxHm | last post by:
I've developed an application that uses the MSMAPI32 OCX to send an e-mail through the default e-mail client application Here is the code ---------------------- axMAPISession1.SignOn()...
3
by: wizzbangca | last post by:
Hi everyone. Having problems with a utility I am writing for work. The previous IT Director thoughtfully allowed 3 (2000, xp, 2003) versions of outlook to be installed rather than 1. Now I need...
2
by: cj | last post by:
I have msmapi32.ocx with file date 7/23/99 2:32pm on my machine. I downloaded the one CMM referenced in his response to my post "Send To Mail Recipient" which has the file date 6/24/98 10:56am. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.