ASP to Word

M

Mojo

Hi All

OK I thought this would be a simple case of connecting to the Word object
and do the same stuff I can do in vb6 desktop dev, but I know I was wrong.

In essence, I created a desktop app that takes data from a DB, munges it and
'pastes' this all over a Word Doc template and although this works fine,
I've got to make the whole app web based to save my sanity! Problem is
doing the old VBA app to Word thing doesn't appear to be a good thing and
info seems sparse on the best way to tackle this. I don't want to go down
the 3rd party COM route as I've been stung by this before when my ISP
wouldn't host a particular COM, so I'd appreciate any pointers anybody could
give.

Thanks
 
B

Bob Barrows

Mojo said:
Hi All

OK I thought this would be a simple case of connecting to the Word
object and do the same stuff I can do in vb6 desktop dev, but I know
I was wrong.

In essence, I created a desktop app that takes data from a DB, munges
it and 'pastes' this all over a Word Doc template and although this
works fine, I've got to make the whole app web based to save my
sanity! Problem is doing the old VBA app to Word thing doesn't
appear to be a good thing and info seems sparse on the best way to
tackle this. I don't want to go down the 3rd party COM route as I've
been stung by this before when my ISP wouldn't host a particular COM,
so I'd appreciate any pointers anybody could give.
Since you need to work with a template, I believe you will need to use a
third-party component like the one offered by ASPOSE for this.I used it
and it worked very well for this purpose.

Microsoft discourages automating Office applications in server-code.
See:
http://support.microsoft.com/default.aspx?scid=KB;en-us;q257757

Alternatively, you could save that template file as html, use
filesystemobject to open a textstream, do your replacements, and write
the result to Response. Depending on the size of the template, this
might work for you.
 
M

Mojo

Hi Bob

Thanks for your reply.

I noticed the ActiveX DLL option, but have had real problems getting this to
work. Is it the case that I can't even use this if I using a Shared Hosting
ISP? I would have thought the registration process is all done on the
client rather than the server.

My feeble failed attempt is as follows:

<HTML>
<HEAD>
<TITLE>TestWord</TITLE>
</HEAD>
<BODY>
<OBJECT ID="clsTestWord"
CLASSID="CLSID:7366ED3D-A93D-404C-B971-1936C37B5DBB"
CODEBASE="TestWord.CAB#version=1,0,0,9">
</OBJECT>

<SCRIPT Language="VBScript">
clsTestWord.ShowDoc "http://myurl.com/progress.dot"
</SCRIPT>
</BODY>
</HTML>

Basically I:

* created a VB ActiveX DLL/Class Module
* created a public sub inside this module that basically opens up the .dot
and displays it.
* built the DLL
* used the package & deploy to get the CAB and the CLSID
* uploaded the asp file, the cab and the dot file to my host

All I get is Object doesn't support this property or method!

Any ideas?

Mojo said:
Hi All

OK I thought this would be a simple case of connecting to the Word
object and do the same stuff I can do in vb6 desktop dev, but I know
I was wrong.

In essence, I created a desktop app that takes data from a DB, munges
it and 'pastes' this all over a Word Doc template and although this
works fine, I've got to make the whole app web based to save my
sanity! Problem is doing the old VBA app to Word thing doesn't
appear to be a good thing and info seems sparse on the best way to
tackle this. I don't want to go down the 3rd party COM route as I've
been stung by this before when my ISP wouldn't host a particular COM,
so I'd appreciate any pointers anybody could give.
Since you need to work with a template, I believe you will need to use a
third-party component like the one offered by ASPOSE for this.I used it
and it worked very well for this purpose.

Microsoft discourages automating Office applications in server-code.
See:
http://support.microsoft.com/default.aspx?scid=KB;en-us;q257757

Alternatively, you could save that template file as html, use
filesystemobject to open a textstream, do your replacements, and write
the result to Response. Depending on the size of the template, this
might work for you.
 
B

Bob Barrows

Mojo said:
Hi Bob

Thanks for your reply.

I noticed the ActiveX DLL option, but have had real problems getting
this to work. Is it the case that I can't even use this if I using a
Shared Hosting ISP? I would have thought the registration process is
all done on the client rather than the server.

My feeble failed attempt is as follows:

<HTML>
<HEAD>
<TITLE>TestWord</TITLE>
</HEAD>
<BODY>
<OBJECT ID="clsTestWord"
CLASSID="CLSID:7366ED3D-A93D-404C-B971-1936C37B5DBB"
CODEBASE="TestWord.CAB#version=1,0,0,9">
</OBJECT>

<SCRIPT Language="VBScript">
clsTestWord.ShowDoc "http://myurl.com/progress.dot"
</SCRIPT>
</BODY>
</HTML>

Basically I:

* created a VB ActiveX DLL/Class Module
* created a public sub inside this module that basically opens up the
.dot and displays it.
* built the DLL
* used the package & deploy to get the CAB and the CLSID
* uploaded the asp file, the cab and the dot file to my host

All I get is Object doesn't support this property or method!

Any ideas?


Since you need to work with a template, I believe you will need to
use a third-party component like the one offered by ASPOSE for this.I
used it
and it worked very well for this purpose.

Microsoft discourages automating Office applications in server-code.
See:
http://support.microsoft.com/default.aspx?scid=KB;en-us;q257757

Alternatively, you could save that template file as html, use
filesystemobject to open a textstream, do your replacements, and write
the result to Response. Depending on the size of the template, this
might work for you.
 
B

Bob Barrows

Sorry, I've never attempted this. I suspect you will need to use an HTML
Application (HTA) which is out of the scope of the ASP newsgroups. If
you wish to pursue that route, you should read up on the subject at
support.microsoft.com
 

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

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top