473,564 Members | 2,758 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Integration with Outlook 2000 – Saving an email as RTF file.

I am trying to loop thru Inbox and select any one email and save it as
a RTF file. Here is the code I am using

Outlook.Explore r myOutlookExplor er =
myOutlookApp.Ex plorers.Add(myO utlookNamespace .GetDefaultFold er(Outlook.OlDe faultFolders.ol FolderInbox),
Outlook.OlFolde rDisplayMode.ol FolderDisplayNo rmal);
myOutlookExplor er.Activate();
Outlook.MailIte m myMailItem = (Outlook.MailIt em)
myOutlookExplor er.CurrentFolde r.Items.Item(1) ;
myMailItem.Save As("D:\temp.rf" , OlSaveAsType.ol RTF);
This is the error message I am getting .

Additional information: Could not complete the operation. One or more
parameter values are not valid.

Any suggestions will be appreciated.

Thanks
Nov 15 '05 #1
3 4184
Krishna,

It could be the string that you are using to save the file to. The
following string:

"D:\temp.rf "

Is actually interpreted as follows:

"D:<tab>emp .rf"

Which is probably the root of the problems. The "\" character is the
escape character and interprets the next character after it in a special
manner. To get around this, you can do the following:

"D:\\temp.r f"

Or:

@"D:\temp.rf "

The @ sign means to interpret the string literally.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- nick(dot)paldin o=at=exisconsul ting<dot>com

"Krishna" <Ki****@yahoo.c om> wrote in message
news:8c******** *************** ***@posting.goo gle.com...
I am trying to loop thru Inbox and select any one email and save it as
a RTF file. Here is the code I am using

Outlook.Explore r myOutlookExplor er =
myOutlookApp.Ex plorers.Add(myO utlookNamespace .GetDefaultFold er(Outlook.OlDe f
aultFolders.olF olderInbox), Outlook.OlFolde rDisplayMode.ol FolderDisplayNo rmal);
myOutlookExplor er.Activate();
Outlook.MailIte m myMailItem = (Outlook.MailIt em)
myOutlookExplor er.CurrentFolde r.Items.Item(1) ;
myMailItem.Save As("D:\temp.rf" , OlSaveAsType.ol RTF);
This is the error message I am getting .

Additional information: Could not complete the operation. One or more
parameter values are not valid.

Any suggestions will be appreciated.

Thanks

Nov 15 '05 #2
Krishna,

It could be the string that you are using to save the file to. The
following string:

"D:\temp.rf "

Is actually interpreted as follows:

"D:<tab>emp .rf"

Which is probably the root of the problems. The "\" character is the
escape character and interprets the next character after it in a special
manner. To get around this, you can do the following:

"D:\\temp.r f"

Or:

@"D:\temp.rf "

The @ sign means to interpret the string literally.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- nick(dot)paldin o=at=exisconsul ting<dot>com

"Krishna" <Ki****@yahoo.c om> wrote in message
news:8c******** *************** ***@posting.goo gle.com...
I am trying to loop thru Inbox and select any one email and save it as
a RTF file. Here is the code I am using

Outlook.Explore r myOutlookExplor er =
myOutlookApp.Ex plorers.Add(myO utlookNamespace .GetDefaultFold er(Outlook.OlDe f
aultFolders.olF olderInbox), Outlook.OlFolde rDisplayMode.ol FolderDisplayNo rmal);
myOutlookExplor er.Activate();
Outlook.MailIte m myMailItem = (Outlook.MailIt em)
myOutlookExplor er.CurrentFolde r.Items.Item(1) ;
myMailItem.Save As("D:\temp.rf" , OlSaveAsType.ol RTF);
This is the error message I am getting .

Additional information: Could not complete the operation. One or more
parameter values are not valid.

Any suggestions will be appreciated.

Thanks

Nov 15 '05 #3
I tried this still does not work.

Thanks
-----Original Message-----
If this is literally your C# code then this is one problem:
myMailItem.Save As("D:\temp.rf" ,
change to:

myMailItem.Sav eAs("D:\\temp.r tf",

--Richard

-----Original Message-----
I am trying to loop thru Inbox and select any one email

and save it as
a RTF file. Here is the code I am using

Outlook.Explo rer myOutlookExplor er =
myOutlookApp. Explorers.Add

(myOutlookName space.GetDefaul tFolder
(Outlook.OlDef aultFolders.olF olderInbox),
Outlook.OlFol derDisplayMode. olFolderDisplay Normal);
myOutlookExplor er.Activate();
Outlook.MailIte m myMailItem =

(Outlook.MailI tem)
myOutlookExpl orer.CurrentFol der.Items.Item( 1);
myMailItem.Save As("D:\temp.rf" ,

OlSaveAsType.o lRTF);


This is the error message I am getting .

Additional information: Could not complete the

operation.One or more
parameter values are not valid.

Any suggestions will be appreciated.

Thanks
.

.

Nov 15 '05 #4

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

Similar topics

2
19319
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 or my conversion skills are weak. And if I have to use tlbimp.exe what is the right file to use. Thanks for the help. -- Fritz
3
5716
by: Kurt | last post by:
Hi We are developing an off-the-shelf software suite for a certain business sector. Most of the program is simply a GUI on top of some .mdb files. Its a .net application written in c# One major requirement is "Outlook Integration". The Outlook contact folders are to be used for contact management I want to know what is the standard way...
1
1691
by: Rob | last post by:
Hello, I am having an application in access 2000.I get a file via email which contains details of trouble tickets and i have set up this to be moved into a folder,outbox.I get this file as a .csv file.it is like this , Subject: ATS Daily Report "Ticket #","Operator ID","Date/Time Reported","Date/Time
2
1945
by: Ronnie | last post by:
I am faced with quite a conundrum. I have been assigned to develop a contact database, that can be queried using many different criterion. Now the hardest part is, my clients want to view the contact information including their e-mails and eventually send them e-mails. Now the output could be a group of 50 people that matched the criterion,...
0
328
by: Krishna | last post by:
I am trying to loop thru Inbox and select any one email and save it as a RTF file. Here is the code I am using Outlook.Explorer myOutlookExplorer = myOutlookApp.Explorers.Add(myOutlookNamespace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox), Outlook.OlFolderDisplayMode.olFolderDisplayNormal); myOutlookExplorer.Activate();...
0
1200
by: RBrady | last post by:
When trying to call this class to create an item in a public folder, I get the following error: Server execution failed at VRInterop.Appointment.FindPublicFolder(String folderName) at VRInterop.Appointment..ctor(String publicFolder, String subject, String body) at VR.Confirm.ibtConfirm_Click(Object sender, ImageClickEventArgs e) in...
10
2826
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 using the office2000 interop dlls generated by vs.net by adding office 2000 com reference. Any one else noticed this problem when targeting...
2
12413
by: Karen Grube | last post by:
Hi! I hate to bother you all with this, but I don't know how best to approach a particular task. Here's the deal: Once a month I receive in my own inbox on my company's Outlook Exchange email server an email from one of our vendors to which is attached a text file (a comma-delimited data file containing the details of our monthly
3
2827
by: Siv | last post by:
Hi, A little while ago I wrote a small program that allowed the user to view products from a database. The database holds the details of the products which can be viewed via a form and additionally pictures of the product are stored in an images subfolder and the database holds the file name of the relevant picture. The user can then click a...
0
7888
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8106
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7642
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6255
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5484
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3643
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2082
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.