creating word/excel document

K

Kerri McDonald

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.
 
T

Tom Kaminski [MVP]

Kerri McDonald said:
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.aspx?scid=kb;EN-US;270906
 
K

Kerri McDonald

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.
 
D

Don Grover

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
 
J

Jeff Cochran

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
 
E

el.c. - myLittleTools.net

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.
 
K

Kerri McDonald

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,138
Messages
2,570,799
Members
47,347
Latest member
RebekahStu

Latest Threads

Top