Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. COM
  4. Word document to stream

Word document to stream

Scheduled Pinned Locked Moved COM
testingtoolstutorialquestion
8 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jan larsen
    wrote on last edited by
    #1

    Is it possible to save a Word Document to a stream using automation? "After all it's just text at the end of the day. - Colin Davies "For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus

    V J 2 Replies Last reply
    0
    • J jan larsen

      Is it possible to save a Word Document to a stream using automation? "After all it's just text at the end of the day. - Colin Davies "For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus

      V Offline
      V Offline
      vishalmore
      wrote on last edited by
      #2

      Yes you can save word file as stream through automaion :) Further elaborate ur problem ! Cheers, Vishal

      J 1 Reply Last reply
      0
      • V vishalmore

        Yes you can save word file as stream through automaion :) Further elaborate ur problem ! Cheers, Vishal

        J Offline
        J Offline
        jan larsen
        wrote on last edited by
        #3

        He he he, you wouldn't work in management would you? :-D Another team on my project, has created code that inserts user data into fields in a word document. I'm creating a web front end, that has to let the user view the document. I don't want the mess with temporary files, and I actually don't have the direct file access to the destination path. So, instead of serializing the document to a file, I want to serialize it to a stream like IStream ( :-) ). "After all it's just text at the end of the day. - Colin Davies "For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus

        V 1 Reply Last reply
        0
        • J jan larsen

          Is it possible to save a Word Document to a stream using automation? "After all it's just text at the end of the day. - Colin Davies "For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus

          J Offline
          J Offline
          Jorgen Sigvardsson
          wrote on last edited by
          #4

          I am unsure if you can store it as a stream. IIRC, word document files are storages, and not streams. I suppose you could save the OLE Structured Storage as a stream, but that's like storing a file system within a file - it probably doesn't do you any good. :) -- My name in Katakana is ヨルゲン. My name in German is Jörgen. My name in Mandarin/Kanji is 乔尔根 西格瓦德森. I blog too now[^]

          J 1 Reply Last reply
          0
          • J Jorgen Sigvardsson

            I am unsure if you can store it as a stream. IIRC, word document files are storages, and not streams. I suppose you could save the OLE Structured Storage as a stream, but that's like storing a file system within a file - it probably doesn't do you any good. :) -- My name in Katakana is ヨルゲン. My name in German is Jörgen. My name in Mandarin/Kanji is 乔尔根 西格瓦德森. I blog too now[^]

            J Offline
            J Offline
            jan larsen
            wrote on last edited by
            #5

            Thanks, I was beginning to wonder if I was going blind, and just couldn't see the method name. The best thing I've come up with, is Get_XML(). "After all it's just text at the end of the day. - Colin Davies "For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus

            1 Reply Last reply
            0
            • J jan larsen

              He he he, you wouldn't work in management would you? :-D Another team on my project, has created code that inserts user data into fields in a word document. I'm creating a web front end, that has to let the user view the document. I don't want the mess with temporary files, and I actually don't have the direct file access to the destination path. So, instead of serializing the document to a file, I want to serialize it to a stream like IStream ( :-) ). "After all it's just text at the end of the day. - Colin Davies "For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus

              V Offline
              V Offline
              vishalmore
              wrote on last edited by
              #6

              See the oulines article, might be help you... This application allows you to save any structured storage file as stream :) and word document is structured storage file :-D http://www.codeproject.com/file/structstor.asp[^] Cheers, Vishal

              J 2 Replies Last reply
              0
              • V vishalmore

                See the oulines article, might be help you... This application allows you to save any structured storage file as stream :) and word document is structured storage file :-D http://www.codeproject.com/file/structstor.asp[^] Cheers, Vishal

                J Offline
                J Offline
                jan larsen
                wrote on last edited by
                #7

                Thanks!, it looks good... "After all it's just text at the end of the day. - Colin Davies "For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus

                1 Reply Last reply
                0
                • V vishalmore

                  See the oulines article, might be help you... This application allows you to save any structured storage file as stream :) and word document is structured storage file :-D http://www.codeproject.com/file/structstor.asp[^] Cheers, Vishal

                  J Offline
                  J Offline
                  jan larsen
                  wrote on last edited by
                  #8

                  :( Bugger, didn't do it for me. The problem is: I have a pointer to a CoClass Document in memory, I don't want to save it to disk, which seems to be the only option in the _Document interface. _Document does not inherit the IStorage or IStream interface, so to use structure storage, I would have to first store the Document on the harddisk, and then open it using eg. StgOpenStorage. :doh: The idea was to stream the document to a web client without touching the harddisk. "After all it's just text at the end of the day. - Colin Davies "For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups