473,500 Members | 1,955 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 ?

Jul 21 '05 #1
4 2551
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.teranew s.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 ?


Jul 21 '05 #2

"Peter Rilling" <pe***@nospam.rilling.net> wrote in message
news:OB**************@TK2MSFTNGP12.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.

Jul 21 '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.teranew s.com...

"Peter Rilling" <pe***@nospam.rilling.net> wrote in message
news:OB**************@TK2MSFTNGP12.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.


Jul 21 '05 #4

"Sue Mosher [MVP]" <su****@slipstick.com> wrote in message
news:OG**************@TK2MSFTNGP10.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

Jul 21 '05 #5

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

Similar topics

7
7506
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...
4
48181
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+....
6
3260
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...
4
1503
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...
4
3270
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...
3
16226
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...
4
6700
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...
3
5783
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...
3
2433
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...
0
7018
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
7232
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
6906
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...
1
4923
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...
0
3110
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...
0
3106
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1430
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 ...
1
672
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
316
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.