creating word/excel document

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Kerri McDonald

    creating word/excel document

    We have an application where the user fills out many screens and when
    they are done, we are supposed to display the text they entered in a
    word or excel format. That is fairly easily accomplished by changing
    the content type in the response object.
    On one of the screens where they enter data, they also have the
    ability to upload a word document containing additional information.
    This is also not a problem, and is working fine.

    Now they have decided that when we create the document with all of the
    text fields in it, they want to embed the word document that they
    uploaded. Is this possible? I have been trying to find a way to do
    this and so far haven't come up with anything.
  • Tom Kaminski [MVP]

    #2
    Re: creating word/excel document

    "Kerri McDonald" <kmcdonald@cds. com> wrote in message
    news:f87f867c.0 310220405.1f0c4 65@posting.goog le.com...[color=blue]
    > We have an application where the user fills out many screens and when
    > they are done, we are supposed to display the text they entered in a
    > word or excel format. That is fairly easily accomplished by changing
    > the content type in the response object.
    > On one of the screens where they enter data, they also have the
    > ability to upload a word document containing additional information.
    > This is also not a problem, and is working fine.
    >
    > Now they have decided that when we create the document with all of the
    > text fields in it, they want to embed the word document that they
    > uploaded. Is this possible? I have been trying to find a way to do
    > this and so far haven't come up with anything.[/color]

    Off the top of my head (I don't know if this will work, but it's worth a
    shot) ...

    Create a Word doc with an embedded doc to simulate the end result you want
    to have. Save this file as an RTF and then open it in notepad so you can
    see the RTF code that was generated - this will allow you to "reverse
    engineer" the RTF so you'll know what you need to do on the server side to
    embed your uploaded file. In other words, instead of just changing the
    content type in the response object, create an RTF file and try to embed
    your uploaded Word doc in that.

    Here's an example of creating an RTF through ASP:


    --
    Tom Kaminski IIS MVP
    http://www.iistoolshed.com/ - tools, scripts, and utilities for running IIS





    Comment

    • Kerri McDonald

      #3
      Re: creating word/excel document

      I tried that. Looks like when I get to the part in the rtf where I
      want to embed the document, it's all ones and zeroes. I tried opening
      the doc I want to embed and reading the binary and writing it to the
      rtf file. Gives me errors when I try that. Although the rtf was
      pretty ugly and I may have missed something it needed. At that point,
      I thought maybe when it embedded the document it puts other special
      characters there that are maybe not necessarily part of the document,
      or maybe it changes it somehow. I don't know. I couldn't get it to
      work.

      After talking with the project manager, it may be acceptable for us to
      just put a link to the document rather than embedding it.

      "Tom Kaminski [MVP]" <tomk (A@T) mvps (D.O.T) org> wrote in message news:<bn5tad$2e 69@kcweb01.netn ews.att.com>...[color=blue]
      > "Kerri McDonald" <kmcdonald@cds. com> wrote in message
      > news:f87f867c.0 310220405.1f0c4 65@posting.goog le.com...[color=green]
      > > We have an application where the user fills out many screens and when
      > > they are done, we are supposed to display the text they entered in a
      > > word or excel format. That is fairly easily accomplished by changing
      > > the content type in the response object.
      > > On one of the screens where they enter data, they also have the
      > > ability to upload a word document containing additional information.
      > > This is also not a problem, and is working fine.
      > >
      > > Now they have decided that when we create the document with all of the
      > > text fields in it, they want to embed the word document that they
      > > uploaded. Is this possible? I have been trying to find a way to do
      > > this and so far haven't come up with anything.[/color]
      >
      > Off the top of my head (I don't know if this will work, but it's worth a
      > shot) ...
      >
      > Create a Word doc with an embedded doc to simulate the end result you want
      > to have. Save this file as an RTF and then open it in notepad so you can
      > see the RTF code that was generated - this will allow you to "reverse
      > engineer" the RTF so you'll know what you need to do on the server side to
      > embed your uploaded file. In other words, instead of just changing the
      > content type in the response object, create an RTF file and try to embed
      > your uploaded Word doc in that.
      >
      > Here's an example of creating an RTF through ASP:
      > http://support.microsoft.com/default...b;EN-US;270906[/color]

      Comment

      • Don Grover

        #4
        Re: creating word/excel document

        Kerri
        I have done this a couple of times and some very complex ones 200-300
        sections like this,
        I have a sample if you like as sample rtf is 200k.

        Only trouble an RTF file is not compressed and can get rather big if its
        complicated.

        Create a rich text file with place markers you can find ie. for an invoice
        number i use ##INVOICENUMBER ## in the document
        Open up rtf file and hit enter so place marker starts on a new line, other
        wise I had trouble finding them.

        Then pad replacing variable to length of marker and replace it.

        I sent you a sample by email as its 60k

        Regards
        Don




        "Kerri McDonald" <kmcdonald@cds. com> wrote in message
        news:f87f867c.0 310220405.1f0c4 65@posting.goog le.com...[color=blue]
        > We have an application where the user fills out many screens and when
        > they are done, we are supposed to display the text they entered in a
        > word or excel format. That is fairly easily accomplished by changing
        > the content type in the response object.
        > On one of the screens where they enter data, they also have the
        > ability to upload a word document containing additional information.
        > This is also not a problem, and is working fine.
        >
        > Now they have decided that when we create the document with all of the
        > text fields in it, they want to embed the word document that they
        > uploaded. Is this possible? I have been trying to find a way to do
        > this and so far haven't come up with anything.[/color]


        Comment

        • Jeff Cochran

          #5
          Re: creating word/excel document

          On Thu, 23 Oct 2003 09:09:00 +1000, "Don Grover"
          <spamfree@assof t.com.au> wrote:
          [color=blue]
          >Kerri
          >I have done this a couple of times and some very complex ones 200-300
          >sections like this,
          >I have a sample if you like as sample rtf is 200k.
          >
          >Only trouble an RTF file is not compressed and can get rather big if its
          >complicated.
          >
          >Create a rich text file with place markers you can find ie. for an invoice
          >number i use ##INVOICENUMBER ## in the document
          >Open up rtf file and hit enter so place marker starts on a new line, other
          >wise I had trouble finding them.
          >
          >Then pad replacing variable to length of marker and replace it.
          >
          >I sent you a sample by email as its 60k[/color]

          Any chance you could send that sample to me as well? I've been
          playing with a similar app and that solution sounds like it would
          help.

          Thanks in advance,

          Jeff
          jcochran at naplesgov dot com

          [color=blue]
          >"Kerri McDonald" <kmcdonald@cds. com> wrote in message
          >news:f87f867c. 0310220405.1f0c 465@posting.goo gle.com...[color=green]
          >> We have an application where the user fills out many screens and when
          >> they are done, we are supposed to display the text they entered in a
          >> word or excel format. That is fairly easily accomplished by changing
          >> the content type in the response object.
          >> On one of the screens where they enter data, they also have the
          >> ability to upload a word document containing additional information.
          >> This is also not a problem, and is working fine.
          >>
          >> Now they have decided that when we create the document with all of the
          >> text fields in it, they want to embed the word document that they
          >> uploaded. Is this possible? I have been trying to find a way to do
          >> this and so far haven't come up with anything.[/color]
          >[/color]

          Comment

          • el.c. - myLittleTools.net

            #6
            Re: creating word/excel document

            > Now they have decided that when we create the document with all of the[color=blue]
            > text fields in it, they want to embed the word document that they
            > uploaded. Is this possible? I have been trying to find a way to do
            > this and so far haven't come up with anything.[/color]

            Kerry

            You should have a look to myLittleWriter, a script component (which
            means you can use it even if you cannot use regsvr on the web server)
            that generates RTF files on-the-fly.
            I think it's worth a look : it can save several hours of hard
            programming...

            myLittleWriter : http://www.myLittleTools.net/mlw

            Best regards
            el.c.

            --
            // myLittleTools.n et : web-based applications for ASP developers
            // Download myLittleAdmin free lite version !
            // http://www.mylittletools.net
            // webmaster@mylit tletools.net


            Comment

            • Kerri McDonald

              #7
              Re: creating word/excel document

              Thanks, but it looks like this doesn't do what I really need, which is
              to embed a word document within the rtf file.

              "el.c. - myLittleTools.n et" <NOwebmasterSPA M@mylittletools .net> wrote in message news:<#NOf#2fmD HA.2080@TK2MSFT NGP10.phx.gbl>. ..[color=blue][color=green]
              > > Now they have decided that when we create the document with all of the
              > > text fields in it, they want to embed the word document that they
              > > uploaded. Is this possible? I have been trying to find a way to do
              > > this and so far haven't come up with anything.[/color]
              >
              > Kerry
              >
              > You should have a look to myLittleWriter, a script component (which
              > means you can use it even if you cannot use regsvr on the web server)
              > that generates RTF files on-the-fly.
              > I think it's worth a look : it can save several hours of hard
              > programming...
              >
              > myLittleWriter : http://www.myLittleTools.net/mlw
              >
              > Best regards
              > el.c.[/color]

              Comment

              Working...