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 3 4186
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
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
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 asa 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 moreparameter values are not valid.
Any suggestions will be appreciated.
Thanks . . This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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
|
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 to do this these days. Most of the information in MSDN seems rather old
I first used the Outlook...
|
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
|
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, and my client wants to be able to e-mail to all of them,
preferably with a single click, just like...
|
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();
Outlook.MailItem myMailItem = (Outlook.MailItem)
myOutlookExplorer.CurrentFolder.Items.Item(1);...
| |
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
c:\inetpub\wwwroot\vr\confirm.aspx.cs:line 162
|
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 office2000/xp mixed
environments? Is there a better, more robust way to do this? Am I better off
using late...
|
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
|
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 button to display the picture in
a pop-up window and also another button to email the potential...
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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 captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |