473,378 Members | 1,478 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

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 1500
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 ?


Nov 15 '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.

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.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.


Nov 15 '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

Nov 15 '05 #5

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

Similar topics

7
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
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+....
4
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...
6
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
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
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
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...
6
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...
3
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
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
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.