By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,813 Members | 1,253 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,813 IT Pros & Developers. It's quick & easy.

creating word/excel document

P: n/a
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.
Jul 19 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
"Kerri McDonald" <km*******@cds.com> wrote in message
news:f8*************************@posting.google.co m...
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.


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

--
Tom Kaminski IIS MVP
http://www.iistoolshed.com/ - tools, scripts, and utilities for running IIS
http://mvp.support.microsoft.com/
http://www.microsoft.com/windowsserv...y/centers/iis/

Jul 19 '05 #2

P: n/a
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:<bn*********@kcweb01.netnews.att.com>...
"Kerri McDonald" <km*******@cds.com> wrote in message
news:f8*************************@posting.google.co m...
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.


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

Jul 19 '05 #3

P: n/a
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" <km*******@cds.com> wrote in message
news:f8*************************@posting.google.co m...
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.

Jul 19 '05 #4

P: n/a
On Thu, 23 Oct 2003 09:09:00 +1000, "Don Grover"
<sp******@assoft.com.au> wrote:
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
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

"Kerri McDonald" <km*******@cds.com> wrote in message
news:f8*************************@posting.google.c om...
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.


Jul 19 '05 #5

P: n/a
> 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.


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.net : web-based applications for ASP developers
// Download myLittleAdmin free lite version !
// http://www.mylittletools.net
// we*******@mylittletools.net
Jul 19 '05 #6

P: n/a
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.net" <NO*************@mylittletools.net> wrote in message news:<#N**************@TK2MSFTNGP10.phx.gbl>...
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.


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.

Jul 19 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.