HELP: Automating Word

R

Rob

Here is my issue: I am trying to load word through vb.net
code behind an ASP.NET webform.
I know it is possible to use the Automation and COM
classes because a co-worker has it working on his machine
with an identical setup.
I am referencing the Interop.Word references. I have read
the Considerations Article Microsoft has written about
using Word at the Server level, I am aware of the security
risks involved as well. However, that all aside, a client
needs to have this work in Word, and, even worse, Word
97. Here is my code:

Dim WordTest47 As Word.ApplicationClass
Dim WordDoc47 As Word.Document

WordTest47 = New Word.ApplicationClass
WordTest47 = CType(WordTest47, Word.ApplicationClass)
WordDoc47 = New Word.Document
WordDoc47 = WordTest47.Documents.Open(strUserPath
& "\Basis.doc")

It crashes on the Open line with an error of:
WordTest47.Documents.Open(strUserPath
& "\BasisTemplate.doc") Run-time exception thrown :
System.Runtime.InteropServices.COMException - Could not
open macro storage.

I have tried everythng: setting up security permissions
in dcomcnfg, user permissions, accounts, etc. I have been
look for over a week straight working on the same
problem. I can not accomplish the same functionality
using any scripting such as VBScript. I simply can not
understand how it will work on two machines in our office,
and yet not on others.

We have checked every setting we can think of. If anyone
knows of anything to check we would greatly greatly
appreciate it. We have wasted a lot of effort and energy
in solving this issue to no avail.

Our current setup is Visual Studio .NET 2003, IIS 5 (both
with latest updates and patches), and Office 97 Pro sr2.

If this is the wrong group I apologize for the post.

thanks in advance,
Rob
 
R

Rob

I realize the Error says TemplateBasis.doc, i just typed
the wrong thing in the post and copied the error. I am
using the same document and it exists.
 
F

Fredrik Wahlgren

Rob said:
Here is my issue: I am trying to load word through vb.net
code behind an ASP.NET webform.
I know it is possible to use the Automation and COM
classes because a co-worker has it working on his machine
with an identical setup.
I am referencing the Interop.Word references. I have read
the Considerations Article Microsoft has written about
using Word at the Server level, I am aware of the security
risks involved as well. However, that all aside, a client
needs to have this work in Word, and, even worse, Word
97. Here is my code:

Dim WordTest47 As Word.ApplicationClass
Dim WordDoc47 As Word.Document

WordTest47 = New Word.ApplicationClass
WordTest47 = CType(WordTest47, Word.ApplicationClass)
WordDoc47 = New Word.Document
WordDoc47 = WordTest47.Documents.Open(strUserPath
& "\Basis.doc")

It crashes on the Open line with an error of:
WordTest47.Documents.Open(strUserPath
& "\BasisTemplate.doc") Run-time exception thrown :
System.Runtime.InteropServices.COMException - Could not
open macro storage.

I have tried everythng: setting up security permissions
in dcomcnfg, user permissions, accounts, etc. I have been
look for over a week straight working on the same
problem. I can not accomplish the same functionality
using any scripting such as VBScript. I simply can not
understand how it will work on two machines in our office,
and yet not on others.

We have checked every setting we can think of. If anyone
knows of anything to check we would greatly greatly
appreciate it. We have wasted a lot of effort and energy
in solving this issue to no avail.

Our current setup is Visual Studio .NET 2003, IIS 5 (both
with latest updates and patches), and Office 97 Pro sr2.

If this is the wrong group I apologize for the post.

thanks in advance,
Rob

You can't create a COM addin for Word97. You need Office 2000 or later.
 
R

Rob

Its not supported, Office 97 was out before any .NET
existed, I realize all of this. But we have it working on
two machines, and not working on two others. Its
definitely possible, it is just a matter of determining
what security settings need to be in place. We have
searched everywhere in posts and through the two computers
that have it working, and we can not find a difference.
We have the same file permissions, the same IIS setup, the
same DCOMCFG setup, it is probably some small change to
some obscure registry setting somewhere that we are
missing, and again, if anyone has any idea I would greatly
appreciate it.
 
F

Fredrik Wahlgren

Rob said:
Its not supported, Office 97 was out before any .NET
existed, I realize all of this. But we have it working on
two machines, and not working on two others. Its
definitely possible, it is just a matter of determining
what security settings need to be in place. We have
searched everywhere in posts and through the two computers
that have it working, and we can not find a difference.
We have the same file permissions, the same IIS setup, the
same DCOMCFG setup, it is probably some small change to
some obscure registry setting somewhere that we are
missing, and again, if anyone has any idea I would greatly
appreciate it.
You have a .Net addin that works on two PC's but not on two other PC's. What
version of Word go you have on these 4 PC'`?Have you checked if any
servicepacks have been installed. Do you have the same .NET runtime
environment? Have you checked what strUserPath & "\Basis.doc" evaluates to?

/ Fredrik
 
R

Rob

Word 97 SR-2, .NET Framework 1.1 .... all is the same, all
updates are there, yes the path is evaluating (the code
creates the path then copies a word document into it
before it opens)...all four machines have identical
hardware, identical software, it just has to be some
strage setting unknowingly set somehow that is giving us
so much grief, and I can not locate this setting. All COM
and permission settings are the same, etc.
 

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

Top