Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Opening Outlook with attachment

Reply
Thread Tools

Opening Outlook with attachment

 
 
=?Utf-8?B?RGFuaXNo?=
Guest
Posts: n/a
 
      03-03-2004
Hi all,
I am trying to open outlook express along with an attachment.
I have added a reference to the Microsoft outlook Library
I am using the following lines of code.
=============================
Outlook.Application OutApp = new Outlook.Application();
Outlook.OlItemType olItem = new Outlook.OlItemType();
Outlook.MailItem OutMail = (Outlook.MailItem)OutApp.CreateItem(olItem);
OutMail.To = ToAddress;
//OutMail.SenderName = FromAddress;
OutMail.Subject= Subject;
//OutMail.Attachments.Add(Filename,);
OutMail.Body = Body;
OutMail.Display(OutApp);
=============================

While compiling it doesnt give any error. However when I run the code it fails at the first line where I am trying to create an object of Outlook Application type
The error says " Acess is denied"

When I try to open outlook using mailto: it opens fine, but I am not able to attach a file to it at the runtime.
Any help on this will be highly appreciated.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Anyone resolved links opening blank page? or box opening in Outlook 2000? S.Rodgers Firefox 13 12-16-2005 03:07 PM
Outlook Error when opening Calender or Outlook Today =?Utf-8?B?c2FuZHdvcm0=?= MCSE 3 10-12-2005 05:38 PM
Outlook Express Attachment Opening Error gregrjones@yahoo.com Computer Support 2 01-22-2005 05:38 PM
please help with attachment opening Josie Computer Support 3 01-22-2005 01:04 AM
Opening attachment Don Jennings Computer Support 15 11-07-2003 05:46 PM



Advertisments