Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ASP to Word

0 views
Skip to first unread message

Mojo

unread,
Aug 3, 2009, 5:09:43 AM8/3/09
to
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


Bob Barrows

unread,
Aug 3, 2009, 9:52:19 AM8/3/09
to
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.

--
HTH,
Bob Barrows


Mojo

unread,
Aug 3, 2009, 10:46:09 AM8/3/09
to
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?

"Bob Barrows" <reb0...@NOyahoo.SPAMcom> wrote in message
news:OKNofGEF...@TK2MSFTNGP03.phx.gbl...

Bob Barrows

unread,
Aug 3, 2009, 11:03:34 AM8/3/09
to

--
HTH,
Bob Barrows


Bob Barrows

unread,
Aug 3, 2009, 11:05:24 AM8/3/09
to
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

Mojo wrote:
> 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.
>

--
HTH,
Bob Barrows


0 new messages