HELP: Automating Word

  • Thread starter Thread starter Rob
  • Start date Start date
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
 
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.
 
Thanks...seen both of those articles already. Nothing
seems to work on my machine. It has to be some obscure
registry or COM or permissions setting somewhere we are
missing. To have it work on two machines, and not on two
others that seem to have the exact same setup, settings,
permissions etc. This has been a frustrating process.
 
Shut down the windows firewall, any other security apparatus running
(zone alarm, spy bot etc) and antivirus software temporarily. Norton
products are notorious for screwing up automation.
 

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

Similar Threads


Back
Top