473,625 Members | 2,615 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Saving file to a string

For a c# program to automatically extract information from email attachments
using the Outlook 9 OM, rather than saving to a file, then reading the file,
I would prefer to 'Save' the attachment to a string variable.

The OM says that .SaveAsFile returns void. The input parameter is a
string.

Is there any way I could somehow 'fool' this method to 'save the file to
string' variable so I don't have to then, open the file and read it back
into a string ?

Nov 15 '05 #1
4 1511
I don't know about your specific question, but if you are not able to get
Outlook work return a string, you could save the file to the temporary
folder and read it in that way. Then remove the file when your program
exits. That would the user the illusion that it is simply reading the file
since there will be no visible evidence of files cluttering the system.
"john bailo" <jb****@vestcom .com> wrote in message
news:28******** *************** *******@news.te ranews.com...
For a c# program to automatically extract information from email attachments using the Outlook 9 OM, rather than saving to a file, then reading the file, I would prefer to 'Save' the attachment to a string variable.

The OM says that .SaveAsFile returns void. The input parameter is a
string.

Is there any way I could somehow 'fool' this method to 'save the file to
string' variable so I don't have to then, open the file and read it back
into a string ?


Nov 15 '05 #2

"Peter Rilling" <pe***@nospam.r illing.net> wrote in message
news:OB******** ******@TK2MSFTN GP12.phx.gbl...
I don't know about your specific question, but if you are not able to get
Outlook work return a string, you could save the file to the temporary
folder and read it in that way. Then remove the file when your program
exits. That would the user the illusion that it is simply reading the file since there will be no visible evidence of files cluttering the system.


That is what I am doing.

But I was hoping to accomplish the same thing without File I/O.

Nov 15 '05 #3
Outlook doesn't permit that.
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
"john bailo" <jb****@vestcom .com> wrote in message news:c8******** *************** *******@news.te ranews.com...

"Peter Rilling" <pe***@nospam.r illing.net> wrote in message
news:OB******** ******@TK2MSFTN GP12.phx.gbl...
I don't know about your specific question, but if you are not able to get
Outlook work return a string, you could save the file to the temporary
folder and read it in that way. Then remove the file when your program
exits. That would the user the illusion that it is simply reading the

file
since there will be no visible evidence of files cluttering the system.


That is what I am doing.

But I was hoping to accomplish the same thing without File I/O.


Nov 15 '05 #4

"Sue Mosher [MVP]" <su****@slipsti ck.com> wrote in message
news:OG******** ******@TK2MSFTN GP10.phx.gbl...
Outlook doesn't permit that.
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

The Politburo has spoken !!!

:D

Nov 15 '05 #5

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

Similar topics

7
7522
by: G-Factor | last post by:
Hi all I've just started learning about saving files. I got bit of a problem. The following code gives me an error about incompatible types. (Cannot covert from class character to char *). I would appreciate it if anyone could either help me out, or direct me to an online resource site that has information on saving/loading classes. I have found several tutorials, but they either do not really help (saving text files) or are too...
4
48208
by: Michael Kennedy [UB] | last post by:
Hi Everyone, I have this multithreaded C# windows forms application which does a lot of image processing. Occasionally, I get the following error: A generic error occurred in GDI+. System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+. at System.Drawing.Image.Save(String filename, ImageCodecInfo encoder, EncoderParameters encoderParams)
4
2563
by: john bailo | last post by:
For a c# program to automatically extract information from email attachments using the Outlook 9 OM, rather than saving to a file, then reading the file, I would prefer to 'Save' the attachment to a string variable. The OM says that .SaveAsFile returns void. The input parameter is a string. Is there any way I could somehow 'fool' this method to 'save the file to string' variable so I don't have to then, open the file and read it back...
6
3281
by: Vijay | last post by:
I need to generate HTML files based on the some codes. One HTML file per code. I have the link (ex:http://123.234.345.456/WebPages/GetTestData.aspx?SomeCode=25), by passing the code as parameter I will get the page displayed. But I don't want to display it, instead save those files in one of the network directories that can be accessed by our third party vended web based application. How can I do this accessing and saving HTML files a...
4
3285
by: dale zhang | last post by:
Hi, I am trying to save and read an image from MS Access DB based on the following article: http://www.vbdotnetheaven.com/Code/Sept2003/2175.asp Right now, I saved images without any errors. After reading the ole object from db, I saved it to C: as file1.bmp and displayed on the web. But it can not be displayed. After I manually sent the file to wordpad, it shows
3
16253
by: andy_ro | last post by:
Hi group, I have an web application where the user can upload a pdf file. This file is stored in a table, in a column of type ntext. The user can later request the content of this column, and the application should open a new page and load the pdf content. My problem: If I read the uploaded pdf file into a string variable and then I response.write it right away to another page, it shows fine (I can see a pdf
4
6718
by: Pedro Leite | last post by:
Good Afternoon. the code below is properly retreiving binary data from a database and saving it. but instead of saving at client machine is saving at the server machine. what is wrong with my code ?? thank you Pedro Leite From Portugal ------------------------------------
6
8111
by: Jeff | last post by:
Hey (and thank you for reading my post) In visual web developer 2005 express edition I've created a simple website project.. At this website I want users who register to be able to upload a picture of themselves to their profile... I admit that I'm a newbie... but this is how I understand this:
3
5789
by: =?Utf-8?B?cmFuZHkxMjAw?= | last post by:
I'm working in Visual Studio 2005 and C#. I'm working in an application that automatically saves a file to a specific directory. I've seen other applications that can detect if a file of the same name already exists, and if so, adds a number to the filename. For example, if foo.doc already exists, the application is smart enough to save the new file as foo.doc.
3
2464
by: pozze | last post by:
Hi, I've just made the change from ASP to .net. I have a file (code below) that saves a user submitted file to a MS SQL 2005 database. It collects the file name, file size, file type, and lastly the binary data for the file. I can sucessfully take the files out of the databse again and display them in a data grid. I would like to resize the submitted file to a fixed size (say 180 x 120) before I upload it to the database and do this without...
0
8251
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, 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...
0
8182
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,...
0
8688
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
7178
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6115
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5570
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4085
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...
1
1800
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1496
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.