Saving file to a string

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • john bailo

    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 ?





  • Peter Rilling

    #2
    Re: Saving file to 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.


    "john bailo" <jbailo@vestcom .com> wrote in message
    news:28be5d4ff8 4adfbc75e921a33 cb53225@news.te ranews.com...[color=blue]
    > For a c# program to automatically extract information from email[/color]
    attachments[color=blue]
    > using the Outlook 9 OM, rather than saving to a file, then reading the[/color]
    file,[color=blue]
    > 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 ?
    >
    >
    >
    >
    >[/color]


    Comment

    • john bailo

      #3
      Re: Saving file to a string


      "Peter Rilling" <peter@nospam.r illing.net> wrote in message
      news:OBBzbWdiDH A.2004@TK2MSFTN GP12.phx.gbl...[color=blue]
      > 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[/color]
      file[color=blue]
      > since there will be no visible evidence of files cluttering the system.[/color]

      That is what I am doing.

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



      Comment

      • Sue Mosher [MVP]

        #4
        Re: Saving file to a string

        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
        Sign in to Shared Email Templates for Microsoft Outlook 365, Outlook web app, and Outlook for Mac.



        "john bailo" <jbailo@vestcom .com> wrote in message news:c848eb2f9f fe658185b052579 27f4f0b@news.te ranews.com...[color=blue]
        >
        > "Peter Rilling" <peter@nospam.r illing.net> wrote in message
        > news:OBBzbWdiDH A.2004@TK2MSFTN GP12.phx.gbl...[color=green]
        > > 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[/color]
        > file[color=green]
        > > since there will be no visible evidence of files cluttering the system.[/color]
        >
        > That is what I am doing.
        >
        > But I was hoping to accomplish the same thing without File I/O.
        >
        >
        >[/color]

        Comment

        • john bailo

          #5
          Re: Saving file to a string


          "Sue Mosher [MVP]" <suemvp@slipsti ck.com> wrote in message
          news:OGifLHgiDH A.2224@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
          Sign in to Shared Email Templates for Microsoft Outlook 365, Outlook web app, and Outlook for Mac.


          The Politburo has spoken !!!

          :D



          Comment

          Working...