473,498 Members | 1,724 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.Explorer myOutlookExplorer =
myOutlookApp.Explorers.Add(myOutlookNamespace.GetD efaultFolder(Outlook.OlDefaultFolders.olFolderInbo x),
Outlook.OlFolderDisplayMode.olFolderDisplayNormal) ;
myOutlookExplorer.Activate();
Outlook.MailItem myMailItem = (Outlook.MailItem)
myOutlookExplorer.CurrentFolder.Items.Item(1);
myMailItem.SaveAs("D:\temp.rf", OlSaveAsType.olRTF);
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 4169
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.rf"

Or:

@"D:\temp.rf"

The @ sign means to interpret the string literally.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- nick(dot)paldino=at=exisconsulting<dot>com

"Krishna" <Ki****@yahoo.com> wrote in message
news:8c**************************@posting.google.c om...
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.GetD efaultFolder(Outlook.OlDef
aultFolders.olFolderInbox), Outlook.OlFolderDisplayMode.olFolderDisplayNormal) ;
myOutlookExplorer.Activate();
Outlook.MailItem myMailItem = (Outlook.MailItem)
myOutlookExplorer.CurrentFolder.Items.Item(1);
myMailItem.SaveAs("D:\temp.rf", OlSaveAsType.olRTF);
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.rf"

Or:

@"D:\temp.rf"

The @ sign means to interpret the string literally.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- nick(dot)paldino=at=exisconsulting<dot>com

"Krishna" <Ki****@yahoo.com> wrote in message
news:8c**************************@posting.google.c om...
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.GetD efaultFolder(Outlook.OlDef
aultFolders.olFolderInbox), Outlook.OlFolderDisplayMode.olFolderDisplayNormal) ;
myOutlookExplorer.Activate();
Outlook.MailItem myMailItem = (Outlook.MailItem)
myOutlookExplorer.CurrentFolder.Items.Item(1);
myMailItem.SaveAs("D:\temp.rf", OlSaveAsType.olRTF);
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.SaveAs("D:\temp.rf",
change to:

myMailItem.SaveAs("D:\\temp.rtf",

--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.Explorer myOutlookExplorer =
myOutlookApp.Explorers.Add

(myOutlookNamespace.GetDefaultFolder
(Outlook.OlDefaultFolders.olFolderInbox),
Outlook.OlFolderDisplayMode.olFolderDisplayNorma l);
myOutlookExplorer.Activate();
Outlook.MailItem myMailItem =

(Outlook.MailItem)
myOutlookExplorer.CurrentFolder.Items.Item(1);
myMailItem.SaveAs("D:\temp.rf",

OlSaveAsType.olRTF);


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
19306
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...
3
5704
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...
1
1686
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...
2
1940
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...
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 =...
0
1195
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...
10
2816
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...
2
12408
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...
3
2817
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...
0
7126
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
7005
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7168
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
7210
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...
1
6891
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...
0
5465
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,...
0
4595
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...
1
659
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
293
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...

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.