Saving file to a string

  • Thread starter Thread starter john bailo
  • Start date Start date
J

john bailo

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 ?
 
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.
 
Peter Rilling said:
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.
 
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
 
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


The Politburo has spoken !!!

:D
 
Back
Top